Automatically close a Form?

JDEAT

Active Member
Hi,
I want to call a form from my own application, fill some form controls with the FI variables and autmatically close this form. For example my P5517501 should call the P17501/W17501A, pass the minimum required fields and close the P17501 to add the record. I am already able to call the P17501 and fill all the fields, but i am not able to close the application automatically. I have already tried to add the logic "press button HC OL" in the 'post dialog is init' as well as in the and in the "Tab page is selected" ER, but it seem's that the "Press Button" command will be ignored.
Adding a MD Debug message to interact with the form the code in the "Tab Page is selected" ER is working fine.
Any ideas ???

Thanks in advance
 
Hi,
Are you sure you want to do this automatic data entry with a form popping up? In my opinion the best way is to use the original form's programmed logic (or just the business functions) at some other place (on a push button or any other event).
Regards:
Gergely Pongrácz
e-Best, Hungary
 
JDEAT,

I have successfully done as you require, but it was a lot of work and trial and error. What I needed was to get the target form to perform it's processes for the FI parameters I gave it, then exit without the user seeing the form at all. To accomplish this I had to copy a lot of ER from their original position and put them in the "Dialog Is Initialized" or "Post Dialog Is Initialized" events. Then I added a PressButton (HC &Cancel) in the "Post Dialog Is Initialized" event to close the form. As the target form was in a standard application, I copied it to a custom application and made the changes in the copied custom application. I did this as I believe that it is "best practice" not to change standard objects unless there is no other way, in which case I keep a copy of the original standard application.

This is a lot of work and requires rigorous testing. If you can avoid doing this, for example following Gergely's advice and "use the original form's programmed logic (or just the business functions) at some other place (on a push button or any other event)", I would recommend it.
 
Back
Top