Skip to main content
Answer

How can I clear data set by PXLongOperation.SetCustomInfo("some text") after PXLongOperation.WaitCompletion(?)

  • October 31, 2025
  • 5 replies
  • 64 views

Forum|alt.badge.img+1

I have an Action on a form that fetches some info from an external API inside a PXLongOperation.  I am putting the resulting json into custominfo with:

PXLongOperation.SetCustomInfo(json);

and retrieving after PXLongOperation with:

PXLongOperation.WaitCompletion(this.UID); 

if (PXLongOperation.GetCustomInfo(this.UID) is string json)
{
f.JsonResult = json;
Filter.Update(f);
}

The problem is that I have date fields in the filter section of the form that trigger the operation completed successfully message every time I change them after the initial action that calls the API completes.

I have tried putting the following immediately after setting f.JsonResult in the if statement:

PXLongOperation.SetCustomInfo(null);

and

PXLongOperation.SetCustomInfo(this.UID, null);

The first doesn’t seem to affect the data which I presumed is because it needs to know the UID and the second throws an error about ambiguity so I tried:

PXLongOperation.SetCustomInfo(this.UID, (string)null);

which clears the error but doesn’t clear the data.

If I debug and check PXLongOperation.GetCustomInfo() in a watch immediately after that line completes it still seems to be retaining the data.

 

Am I missing something simple here?

 

Thanks for any advice anyone has,

 

Phil

Best answer by Dmitrii Naumov

@ppowell 

to wrap async code I recommend the following approach instead:

https://github.com/Acumatica/httpRequestExample/blob/2025r2/ARSetupMaint.cs#L43

5 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • October 31, 2025

Hi ​@ppowell 

Why do you have the long operation in the first place? Do you use it to wrap the async code?


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • November 1, 2025

@Dmitrii Naumov Yes. It wraps an async GET call to the API in an external DLL.

Thanks for your reply,

Phil

 


Forum|alt.badge.img+1

Hi ​@ppowell 

You can try implementing the IPXCustomInfo interface for your CustomInfo object and then process it as described in this article.

https://asiablog.acumatica.com/index.php/2016/07/new-way-to-work-with-custominfo-of/


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • November 3, 2025

@ppowell 

to wrap async code I recommend the following approach instead:

https://github.com/Acumatica/httpRequestExample/blob/2025r2/ARSetupMaint.cs#L43


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • November 4, 2025

@Dmitrii Naumov Thanks for your reply.  Using LongOperationManager instead of PXLongOperation fixed the issue for me.

Phil