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