How To: mark a long run operation status to completed status

  • 26 February 2021
  • 3 replies

Userlevel 4

Hello Everyone,

I have a custom button action with a long run to execute some business logic. Now, have a requirement where have to perform some updates based on the latest modifications performed by this long run.

Is there a way we can set the long run operation status to completed, so that the record gets updated in DB and I can fetch those modified records and perform my updates in the same button click.

Thanks in advance!


Best answer by jknauf 26 February 2021, 15:31

View original

3 replies

Userlevel 4

Thank you for the input @jknauf @Gabriel Michaud. I will try the suggested approaches.

Userlevel 7
Badge +10

Dear @vivekm,

If I recall correctly, caches are cleared and the record is reloaded after a long-operation completes.

Is there any reason why you can’t perform the modifications and updates based in the long-run it self? Is it a separation-of-concerns issue?

If you want to run code after the long operation completes, you can create a class that implements IPXCustomInfo which contains a single function:

void Complete(PXLongRunStatus status, PXGraph graph). 

In the first long of your long operation, call:



Userlevel 3

Hey there vivekm,

So long operations are automatically set to the status of completed once the long process completes in it’s separate thread. You can read about that here:

If you want more code to execute once this has completed, try using: 


// your code to execute after the operation has completed goes here


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved