Putting a Form into Edit Mode via Code (or Work-Around)

To explain the feature request, I need to give some background.

I have a GenerateEmails form. it is bound to my EmailTypes table, which has EmailTypesKey (GUID), SendToType (text), Seq (number), DefaultSubject, and DefaultBody.

Nothing needs to be saved here, it is just a form to send out emails. There are several unbound fields: To, Cc, Bcc, Subject, Body. The whole purpose of this form is to enter information and send emails. Subject and Body get their values from hidden DefaultSubject and DefaultBody bound fields.

When using this form, I can’t really make any entries if the form is not in edit mode, which I can accomplish by clicking the pencil, or double-clicking a field (although that is hit-or-miss).

So finally, here are the feature request(s) that could help me in this scenario:

  1. Allow a command to put the form in edit mode via code. Should be simple, just do what clicking the pencil does.
  2. Allow a field to be modified without the form being in edit mode. If this was a property of the fields, I could get this form to work easier.
  3. Allow a command to undo the edit via code. In an email form, once I generate the email, there is no reason to save anything.
  4. Allow a process to have pages, just like a form does. A process would work without some of the limitations of forms, but I would need to have the other pages to select various things that are pertinent to sending the emails.

Any of these enhancements would help me send my emails, but I have no idea of the relative difficulty of each of them.

Thanks for your consideration…

Hi Ron,

Thank you for your Suggestions.

We are going to analyse them, and I will keep you informed about any decision.

Regards,
Elton S

Hi Ron,

Just in case it may be helpful,

Instead of adding pages to a process, have you tried using the form and adding a process as an Action?

In this way, you have the form and the action as a page, which is a process with all unbound fields (No save and no Edit button).

In this example, you can see that when clicking on the page (Process page), it executes a function that populates all the fields based on the form record selected(In case you want the fields to be pre-populated).

Regards,
Elton S

AppPageProcess-20260222-23211965564147.fdf (3.4 MB)

Wow, that’s a great idea! I didn’t know that a form page could be a process.

Is it possible that the main (General) page can be the process page? That would solve all my problems. I could then leave the other action pages as they are.

Thanks…

Ron Mittelman

Hi Ron,

When you add a page, you can change the order in which the page appears, making the page with a process appear first.

Regarding your question, only Forms can have a General page.

Regards,
Elton S

Thanks Elton.

I created a new form and the first page I called General out of habit. It’s an action page pointing to a process. This works, sort-of.

I based the new form on my EmailTypes table, just like the previous form. I added 2 fields to the General page for EmailTypesKey (GENERIC) and EmailType (Generic Email). I told both fields to appear in list.

Unfortunately my “General” page is an action page pointing to a process, so these fields do not show. I understand I can add screen fields and populate them in code, but the big problem is that my list on the left has the expected 3 records, but no text to identify them. I know from experience that the first one is for GENERIC, but it doesn’t show in the list. Am I doing something wrong? how can I get the list to show the 3 record values?

Hi Ron,

The list on the left will only be displayed for form fields connected to a table.

Unbound fields won’t be displayed.

Only a form can have a page, so when you say “my “General” page is an action page pointing to a process“, I don’t know what you mean by that, or do you mean that your general page has an action page that points to a process?

Can you detail this issue for a better understanding? If you prefer to share an app with a version of your settings, and details what you are expecting, it would be very helpful.

Regards,

Elton S

I’m confused. I created a brand new form. I added a page and named it General. I set that page to an action page, and pointed it to the Process. Don’t be confused by the fact that it’s called General.

I added 2 fields on the page, set them to show on list. But since it’s an action page using a process, those “real” fields don’t show on the form or the list. I suppose if I made a standard form page instead, the fields would show on form and list. But that means I would have to make a new page for the process.

The first (General) page would only have 2 fields on it, and the user would need to click on the new second page (the process) to see the process fields.

If I understand this correctly, the user must do a lot of page navigation to get this to work using a process.

On the other hand, what about selectively hiding the first (General) page? If the showIf field says false, would the form still work, showing the desired fields in the list? Those 2 “real” fields will be read-only anyway.

Thanks so much…

Hi Ron,

Please, let me know if this works for your scenario:

Using the sample app previously provided, if you navigate to the form ‘Emails`.
Select the record ‘General’ which is a form and set the ‘Show If’ field to be false.

When you run the application, you can still see the list of records (left side), but when selecting the record, the form page won’t be displaying only the Process which is the second page.

Regards,
Elton S

I was able to get this working by restoring the General page as a true form page, and adding the table fields to it. Then created a new page called EmailInfo to host the process and contain its screen fields. This works so the record fields are showing in the list again. Later I will hide the General page.

What is not working is going to the Members page and selecting several members, then returning to the EmailInfo page and having those selected members being displayed in the SendTo field.

When I was doing this on the form only, I’d set a variable in the client function which selects/unselects members. this variable would summarize all members which were selected. Returning to the first form page, the variable was used to fill the SendTo field.

What I’m finding is that in the new form, which uses a Process page, the Process has no knowledge of the variable which was saved during the client function that switched selection status of Members.

Now I’m wondering if instead of a variable being set, couldn’t the client function responsible for changing selection status of members simply write that information to a form field instead of to a variable?

I’ve demonstrated that the process can be aware of parent form fields, because that is how I set DefaultSubject and DefaultBody (both table/form fields) values into the Process screen fields of Subject and Body.

So can the client function (which is triggered by the Members page DataView) also update a form field?

Sometimes I can read/write those fields directly, and sometimes I need to use the form’s DataManager to do this. It’s not clear why.

So what I need is a reliable way for the client function, which is run by a click event on the DataView to be able to update the parent form’s fields.

I hope I’ve explained this clearly…

Hi Ron,

Thank you for providing more details regarding your application.

These are the answers to your questions. Please let me know if you still have any questions.

1 - What is not working is going to the Members page and selecting several members, then returning to the EmailInfo page and having those selected members being displayed in the SendTo field.

Answer: I have attached an example application where clicking a button on the Data View updates a value in the form (General page), field Email From. This works whether the form is in edit mode or creating a new record.

Two functions handle this process: FunctonUpdateFormField and SaveDataManager.

AppPageProcess-20260309-020812081748886_forRon.fdf (3.4 MB)

2 - What I’m finding is that in the new form, which uses a Process page, the Process has no knowledge of the variable which was saved during the client function that switched selection status of Members.

Now I’m wondering if, instead of a variable being set, couldn’t the client function responsible for changing the selection status of members simply write that information to a form field instead of to a variable?

Answer: If you need to set a variable in the front end and access it in the back end, you can use a callback function. Note: In the future, this functionality will be available globally, allowing variables set in the front end to be retrieved in the back end and vice versa.

3 - So can the client function (which is triggered by the Members page Data View) also update a form field?

Answer: The question was addressed in my initial response, which includes an example application.

Regards,
Elton S