How to press Ok in Post Dialog Initialized

batoha

Active Member
Hello everybody!
Does anybody know how to force execution of Ok menu exit in Fix/Inspect form at the form startup to exit form with saving and avoid any user interaction?

Best regards.
 
Hi Sergey,

Issue a PressButton(HC &OK) system function call (Genaral category).
I did it already more times in custom applications.

Regards,

Zoltán
 
Everything is not as easy. It doesn't work inside Post Dialog Initialized event.
 
Hi Sergey,

What is the problem? What does not work?

The Fix/Inspect form does not return?
If yes, then check the "End-Form-On Add" form property. Mark it, if it is unchecked!

Waiting your feed back,

Zoltán
 
I'm trying to automatically close form W43060A in application named P43060. Blanket release.
And it doesn't close even if I mark close on add checkbox.

Sergey.
 
Hi,

I had this kind of situation long time ago, if I am right, your form interconnect has data item mapped in the fix inspect form when you are calling, you can not close the form using system function or using the form properties change unless you do it mannually.

If it is in ADD mode, do not map any data elements when calling the form.

In the UPDATE mode, system will wait for manual click on OK button.

If possible change UPDATE mode to ADD mode of calling( This needs to be done programmatically as there is no logic available in the system) and then try system function and the change of form property.

I hope this will help little bit.

Bala Chellam
ERP Consultant
E810, AS/400, Citrix
 
Hi Sergey,

Q1.) Is the form called without passing any parameter in the form interconnect data structure? (this is generally required for Add mode)

Q2.) Does the Fix/Inspect form contains ER in Asynch events?
(print the ER with Form scope to .txt file and search the .txt for "Async")

Q3.) Does the form return if you run it under the Debugger?


If Q1 = Yes AND Q2 = Yes AND Q3 = Yes, then maybe your situation is similar, as I had some month ago with Headerless Detail form.

That time I have got a GREAT help from WhippingBoy (Darren Ricciardi), create a C BSFN to press OK in a separate threat with a bit delay, while all asynch events finished.

Please, check the "PressButton(HC OK) problem and Debugger" thread here, on the developer's forum for Darren's help.

Good luck - and let us know your progress.

Regards,

Zoltán
 
Everything is correct. I have form interconnect with data items. And form is in update mode.

Sergey.
 
The problem of all this is that I need to create procedure to allow user to release full quantity of purchase order as it is possible in 42 system. But everything is spoiled up by the great tool we all use - FDA. They put release handling on OK menu item and didn't allow us to press it whenever we want to. They also didn't give us ability to easily copy code from one ER to another. In other words they just squeezed our balls.(sorry for that outburst)

Sergey.
 
Just a thought,

In Update Mode,

Before you use system function of press button(OK), assign some meaning full values to the form interconnect in dialog initialized event and make sytem understand that some thing has been changed in the form interconnect values.

My assumption is system will let you close the form.

Let me know this works or Not.

thanks,
Bala Chellam
ERP Consultant
E810, AS/400, CITRIX
 
Hi Sergey,

Here are my last 0.02$.

1st 0.01$:
- Does any Warning come up when you press OK? If yes, issue the PressButton(HC &OK) twice.

2nd 0.01$:
- Have you ever debugged the APPL, that PressButton statement executed at all?
- What is the setting for "No Fetch Form Business View" form properties?

>> Development manual states (Appendix: Process Flow for Fix/Inspect Form)
>>>>>
...
11. If "No Fetch Form Business View" is checked
* Perform Event Rules: "Post Dialog Initialized"
...
<<<<<

Maybe your "Post Dialog Initialized" event does not executed at all.
If this is the situation, then you can move PressButton to the "Dialog is Initialized" event.

I already used this technic (pressing OK programatically from ER) on many form, as well on custom forms as on copied vanilla forms.

Really hope, we will find the solution now, because my cash desk balance is 0.00$ :)

GOOD LUCK! - at keep us informed. Thanks.

Regards,

Zoltán
 
I've got the same problem but I have to use data elements for both update and add modes and my form only work in update mode...

You're talking about switching from update mode to add mode:
do you have an example to provide ?
 
Zoltan. You probably should try to press Ok programmatically in P43060 on release quantity setup form. If you lucky on this just drop me a line so I could feel envy.

Sergey.
 
Hi Sergey,

>> "Zoltan. You probably should try to press Ok programmatically in P43060 on release quantity setup form. If you lucky on this just drop me a line so I could feel envy."

OK. I wasn't as lazy to try, what you "advised" me, as...

- I pressed Ok programmatically in P43060 on release quantity setup form (W43060 - Order Release), on the end of Post Dialog is Initialized event
- Originally it did not return
- I wasn't lazy to follow somebody's suggestions (published here recently :p
- Voila - OK returns now.
- You could feel envy :p (or read and try the suggestions of the others ;)

Regards,

Zoltán
 
Hi Sergey,

I also response my questions to you:

Q2.) Does the Fix/Inspect form contains ER in Asynch events?
(print the ER with Form scope to .txt file and search the .txt for "Async")

>> I printed out the ER with Form scope to a .txt file, searched for "Async" in the file and found 3 Asynch events (Your answer was "No")

Q3.) Does the form return if you run it under the Debugger?

>> I built the debug info for the APPL and started the APPL while debugger was running. The OK returned. (Your answer was "No. It just crashes :)"

I followed the GREAT help of WhippingBoy (Darren Ricciardi), to create a C BSFN to press OK in a separate execution thread with a bit delay, while all asynch events finished.

Pressing the OK using this BSFN call (instead of PressButton systemfunction call) the form returns after the preset delay passed.

I really hope, it will be a solution for you too.
If yes, then please, thank it to Darren Ricciardi (WhippingBoy).

Regards,

Zoltán
 
Ok, Zoltan.
1. I wasn't too punctual and missed 3 asynch events on dates fiels. I acknowledge that. But...
2. It is definitely crashes. If I select more than 1 records to release from and go through Ok button processing it really executes Ok, then PostButtonClicked, then End Dialog and than HANGS UP. And finally when I press "Disconnect" it crashes (as it usually does).
3. When I was programming in Oracle Developer2000 environment it was dirtiest way to use delays to avoid validation triggers to stop what I wanted to do. This is used when there is no any other way to pass through. But even there I was able to close form programmatically as easy as 123.
Anyway I appreciate your assistance and I'll try to find a
WhippingBoy function.

Sergey.
 
Back
Top