Skip to main content
Answer

Issue Overriding POOrderEntry Release from Hold

  • June 14, 2025
  • 2 replies
  • 74 views

Forum|alt.badge.img+1

Hi,

 

Have been battling with an issue with an override to ReleaseFromHold in POOrder Entry. 

 

What I am needing to do is make an API call on another Acumatica Instance to create a Sales order that is linked to the Purchase Order

Code is below:

 

The method ReleaseIntercompany is not the problem.  I have the same issue even if the call is commented out such that the code becomes:

 

 

I have narrowed this down to the presence of the Base.Save.Press().  This is required because if ReleaseFromHold is pressed before the order is saved, then the OrderNbr of the PO is not known and I want to send this in the API to create the Sales Order in the other tenant to store the value in a custom field.

What happens, when the PO is released with the code above is that the user is left with a form that looks like:

All the fields in the header are blank.  The order has saved, and has been released as you can exit and go back in and all the data is there.

I’m thinking that I could just right a custom action that calls the ReleaseFromHold action and then performs the call to ReleaseInterCompany, but there must be a batter way?

 

Thanks in advance for any assistance.

JOhn.

 

 

Best answer by JWS539

Hi,

Managed to figure this one out by watching what was happening in the cache.

After the call to the base method on Line 76 below the SOOrder object is in the cache as Update.

The ReleaseInterCompany method was:

  1. Saving the SOOrder record so the OrderNbr became known.  
  2. Making the API calls to create the SalesOrder and Release it in the other Acumatica instance/tenant.
  3. Update a User defined field on SOOrder with OrderNbr from the PO created in step b. Above
  4. Saving the SOOrder record (using Base.Save.Press()) 

After the code returned from ReleaseInterCompany() on line 78 below, SOOrder was no longer in the cache as Update.

Issue was caused by Base.SavePress() persisting the SOOrder objet and removing it from the Update cache.  Removing Step d above so that it was non-persisted coming out of ReleaseInterCompany solved the issue.

 

Is all working now.

 

Thanks,

John.

2 replies

Forum|alt.badge.img+1
  • Author
  • Varsity II
  • June 14, 2025

Further to the above,  I have attempted to create a custom action for the workaround mentioned above but can’t seem to trigger the Release from hold in the Base Graph:

 

 

At this point I’m thinking may be:

  1. Custom Action in source tenant makes API call to create Sales Order in other tenant
  2. Wen the other tenant Processes the API call, and the sales order is persisted, make an API call back to the source tenant to release the originating PO

Would work but seems convoluted.  Must be another option.

 

Thanks,

John.

 


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • Answer
  • June 15, 2025

Hi,

Managed to figure this one out by watching what was happening in the cache.

After the call to the base method on Line 76 below the SOOrder object is in the cache as Update.

The ReleaseInterCompany method was:

  1. Saving the SOOrder record so the OrderNbr became known.  
  2. Making the API calls to create the SalesOrder and Release it in the other Acumatica instance/tenant.
  3. Update a User defined field on SOOrder with OrderNbr from the PO created in step b. Above
  4. Saving the SOOrder record (using Base.Save.Press()) 

After the code returned from ReleaseInterCompany() on line 78 below, SOOrder was no longer in the cache as Update.

Issue was caused by Base.SavePress() persisting the SOOrder objet and removing it from the Update cache.  Removing Step d above so that it was non-persisted coming out of ReleaseInterCompany solved the issue.

 

Is all working now.

 

Thanks,

John.