P42101 Form not closing after OK Button


Active Member
Hello Group,

Thanks for reading. I am working on P42101. We have requirement to update F4211 and custom table just after Order is committed. So in P42101 on "OK" button from Event Post Button Async , I commented the "Sales Order Application Controller - External (B4210900)"and moved it to OK Button click event. Now after this BSFN I execute my custom code and update the F4211 and Custom table. Updation works. But the P42101 form does not close and it stays with the data. However the cache is committed to database and record is created in F4211. If we again Press "Submit & Close" it gives error. I even tried to use Set Behavior but still form does not close.

I used the link below to update F4211 after End Doc in Power forms. All works but the form does not close.

Attached is the error after clicking "Submit Close" second time.

Any idea why form P42101 does not close. Thanks for your help.


  • Error.JPG
    50.1 KB · Views: 11


Legendary Poster
My only guess would be that it might possibly have something to do with transaction processing????. Pristine code calls the controller function that ultimately calls F4211FSEndDoc in a TP boundary. If you are trying to do additional ER code based updates to the table there may be some sort of conflict there since F4211FSEndDoc is happening in a transaction on the ES server and your ER code table udpates are happening on the JAS server. This is just a pure guess though... it could be a million things.

If you want to update the sales order tables after F4211FSEndDoc completes in this manner try creating a wrapper function to B4210900 that has the same data elements in the DS plus the additional data elements you wish to write to the sales tables. Then call B4210900 in your wrapper function and after it completes do your table updates in the wrapper function instead of ER code in P42101. In this way you just replace B4210900 with your wrapper function and that function call can be placed on the same P42101 event as B4210900 with the same calling properties (transaction processing). Now all the database writes happen within the TP boundary on the ES server. It also allows the function to continue to be called async.

To summarize:
Currently what I believe you may be attempting
  |-<more function calls>
|-ER Code updates to Sales Tables (Done in ER code in P42101)

    |-<more function calls>
  |-ER Code updates to Sales Tables (Done by YourWrapperBSFN)