In the code below the Function SetPayCode sets the InvoiceNumber field for each billing record selected from the Session Form which has a current InvoiceNumber value of "0 (Not Yet Billed)... to the value of the field named Code that exists in a InvoiceNumberList Form record with the field named FilterAid that has the value "new". AFTER the function completes all these record updates, ONLY THEN do I want to initiate the openURL of the form Invoice which loads with the values aggregated from those Session records which were just updated.
I'm not sure this can be done in a Custom Action, and have been studying
This Answer by Latha and Ruben as an alternative route, but have not been able to understand it completely enough to experiment with it. Any help will be appreciated.
- void SetPayCode(Session NotBilled)
- {
- for each NotBilled in Session
- {
- if (NotBilled.InvoiceNumber == "0 (Not Yet Billed)")
- {
- rec = InvoiceNumberList [FilterAid == "new"];
- NotBilled.InvoiceNumber = rec.Code;
- }
- }
- openUrl("#Form:Invoice", "Popup window", "height=500,width=400");
- }