Alternative title: Eject me from the forms system fast! Close all forms without all those pesky validations.
This week a need arose at a customer site to exit all open forms (with one button click ) and return to the first form with the main menu.
This need may also arise when the user creates a large workflow of different forms calling each other but then wants to close all called forms with one button.
The steps are quite simple:
1) You begin by putting the following code in the WHEN-NEW-FORM-INSTANCE trigger of all the forms in the application
DEFAULT_VALUE(‘false’,'GLOBAL.closing’);
This will create a new global variable called “closing” in your forms system. This value will be false by default and it will be changed to true when the process to exit all has been triggered.
If you do not have a global program unit in your WHEN-NEW-FORM-INSTANCE trigger for all forms, then you will want to use one of the methods to update forms in batch that are available. You can use either JDAPI or convert all forms to XML and add this code in Notepad++ ( for more information you can check out Blog posts: JDAPI, Converting Forms to XML)
2) Next step is to check each form when the window is activated if we are in the process of exiting all or if we have reached the main form yet. Here we want to test
(a) Is the global called “closing” set to true? If so we are in the middle of the exit all process
(b) Have we reached a form called . If so we have already arrived to the main navigation form.
To do this we put the following code in WHEN-WINDOW-ACTIVATED trigger of all system forms. Again this may be done in batch (see above)
:IF :GLOBAL.closing = ‘true’ AND GET_APPLICATION_PROPERTY (CURRENT_FORM_NAME) <> ‘’
THEN
EXIT_FORM(NO_VALIDATE);
ELSE
:GLOBAL.closing := ‘false’;
END IF;
EXIT_FORM(NO_VALIDATE);
ELSE
:GLOBAL.closing := ‘false’;
END IF;
We do an exit all without form validation here. This means that if the form has not yet been saved, all changes that were done will be automatically saved. If this is not appropriate for your system then simply replaces the EXIT_FORM (NO_VALIDATE) with EXIT_FORM(NO_VALIDATE,FULL_ROLLBACK) This will be the only way that the forms can close without user intervention. Since if the forms have outstanding changes that require validation it will prompt the users to correct or commit the changes.
Also in the above code don’t forget to replace with the name of the main menu or navigation form.
3) The final step in the process is of course how we start the exit all domino effect. This can be done by simply adding an exit all or close all button in the main menu or toolbar.
This button should appear on all forms so anywhere that is seen globally in all forms should be fine.
The code of the button should look like this:
:IF GET_APPLICATION_PROPERTY (CURRENT_FORM_NAME) <> ‘’
:IF GET_APPLICATION_PROPERTY (CURRENT_FORM_NAME) <> ‘
THEN
:GLOBAL.closing := ‘true’;
:GLOBAL.closing := ‘true’;
EXIT_FORM(NO_VALIDATE);
END IF;
END IF;
Again you can replace the exit_form command with what's appropriate for your system.
So that's it! As you can see, this is so simple the most time consuming part will be deciding what icon to put on the exit all button. Even here I can help. Check out the links below.
Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
ReplyDeleteBest Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies
Best AWS Training in Chennai | Amazon Web Services Training in Chennai
Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
ReplyDeleteangularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
angularjs-Training in velachery
angularjs Training in bangalore
I really like your blog. You make it interesting to read and entertaining at the same time. I cant wait to read more from you.
ReplyDeleteJava training in Rajaji nagar | Java training in Kalyan nagar
Java training in Kalyan nagar | Java training in Jaya nagar
I am so proud of you and your efforts and work make me realize that anything can be done with patience and sincerity. Well I am here to say that your work has inspired me without a doubt.
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
Read all the information that I had given in above article. It was giving the whole Idea respective to the topic.Such an useful time.
ReplyDeletegreat information has been shared by the blog.
Java training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training