Framework call a form and save state of the calling form

I have a form A, which has the toolbar from the framework and I need to call this form A with the framework toolbar functionality from another form B. After using form A I just want to switch back to form B.

For example:

Form A has the functionality to add customers. In form B I need a list of these customers. Sometimes it’s necessary to add customers in form B, so I just want to save the state of form B (e.g stay in new entry mode), call the form A to add a new customer and then switch back to the form B to just select the new customer from the list.

Problem:

From A has the framework toolbar buttons to add new entry or to save the entry. If I just use one of the following functions:

plugins.window.showFormPopup(elementToShowRelatedTo,form,scope,dataproviderID);
globals.DIALOGS.showFormInModalDialog(formName);
application.createWindow(windowName,type).show(form);
application.showForm(form);

I can’t get the toolbar functionality.

How can I call a form A with the framework toolbar functionality from another form B and then switsch back to the saved form B state after using form A?

1- A framework that uses data to drive navigation means you can’t just go to a form directly via something like "application.showForm(form). Well you can, but you bypass the framework navigation functionality. The framework should have api methods for programmatically doing things like navigation (replicating a user clicking a navigation item).

2- If form A and B share the same foundset and the method you want doesn’t do any UI work, you can call “forms.formA.someMethod()” from form B and it will work. If they don’t share the same foundset, you need to write a new method. If they do share but form A method does UI work, abstract out the part of the method that is generic and call this from form A and form B methods and add form specific logic to each call.

david:
2- If form A and B share the same foundset and the method you want doesn’t do any UI work, you can call “forms.formA.someMethod()” from form B and it will work. If they don’t share the same foundset, you need to write a new method. If they do share but form A method does UI work, abstract out the part of the method that is generic and call this from form A and form B methods and add form specific logic to each call.

I found a function in the framework to open another UI form A as a tab with the toolbar functionality. Form A doesn’t share the same foundset with form B. Both forms are UI forms where the user can input data, so I have to wait for the user until he finished his action on form A. Is it possible to use a callback function, that is executed, if the user finished his action on form A? If yes, how should I implement the callback function?

Repurposing existing workflows (individual table data entry) into a new workflow (go here, enter something, come back) isn’t a smooth proposition. What if the user decides to navigate somewhere else before finishing data entry?

The pattern you want is a modal dialog. And it is tough to reuse a main form as a modal dialog form as functionality can be quite different.

The proper way to do what you want is to create a modal dialog specific form (copy elements from another form as needed), create just the functionality needed for when the form is in modal mode (save, cancel, etc), and then open it up where it is needed.

There is another pattern that works quite well: a list of actions a user needs to do for a task in a sidebar or something. Clicking on a list item takes the user directly to the screen where they can do the task. When they are done, they check off the task and move on to the next one.

Entire applications (“Business Process Management/Control.”) are written for this sort of thing. Tasks can be assigned to people, given due dates, propagate new tasks when finished, etc.