Skip to main content
Question

Processing dialog loops/reappears after completion in custom PXAction

  • April 17, 2026
  • 2 replies
  • 30 views

Hi everyone,

I'm experiencing a strange behavior with a custom action in a processing screen (similar to Process Orders).

The Issue: When the process finishes, the "Processing" summary dialog appears correctly (showing 1 Success, 0 Errors, etc.). However, when the user clicks the "Close" button, the loading spinner appears briefly, and then the same success dialog pops up again. This creates an infinite loop where the only way to exit is to manually refresh the browser page.

Observations:

  • This happens even when the process is successful.

  • It occurs across multiple different custom actions I've developed.

  • I am using PXLongOperation.StartOperation to handle the logic.

 

Code Snippet: Below is the logic for one of the actions causing this:
 

public PXAction<SOOrder> FRcreateTransfer;
[PXButton(CommitChanges = true), PXUIField(DisplayName = "Create Transfer", MapEnableRights = PXCacheRights.Select)]
public virtual IEnumerable frCreateTransfer(PXAdapter adapter, [PXDate] DateTime? shipDate, [PXInt] int? siteID, [PXDate] DateTime? endDate, [PXInt] int? usrFRLocationID) 
    => ExecuteFRCreateTransfer(adapter, shipDate, siteID, endDate, usrFRLocationID, SOOperation.Issue, true);

private IEnumerable ExecuteFRCreateTransfer(PXAdapter adapter, DateTime? shipDate, int? siteID, DateTime? endDate, int? filterLocationID, string issue, bool v)
{
    List<SOOrder> list = adapter.Get<SOOrder>().ToList();

    // ... Filter logic ...

    PXLongOperation.StartOperation(Base, delegate ()
    {
        bool anyfailed = false;
        var orderEntry = PXGraph.CreateInstance<SOOrderEntry>();
        
        for (int i = 0; i < list.Count; i++)
        {
            SOOrder order = list[i];
            if (adapter.MassProcess) PXProcessing<SOOrder>.SetCurrentItem(order);

            try
            {
                // ... Business Logic (Creating Transfer) ...

                if (adapter.MassProcess) PXProcessing<SOOrder>.SetProcessed();
            }
            catch (Exception ex)
            {
                if (!adapter.MassProcess) throw;
                PXProcessing<SOOrder>.SetError(ex);
                anyfailed = true;
            }
        }

        if (anyfailed)
            throw new PXOperationCompletedWithErrorException(ErrorMessages.SeveralItemsFailed);
    });

    return list;
}

 

What I've tried: I suspect it might be related to how the IEnumerable returns the list or how the adapter state is being handled after the PXLongOperation starts.

Has anyone encountered this "Success Dialog Loop" before? Any advice on how to properly terminate the operation so the dialog closes permanently would be greatly appreciated.

Thanks in advance!

2 replies

Forum|alt.badge.img+3
  • Pro III
  • April 20, 2026

@mcoral62 

The issue comes from the return statement at the end of your method. After PXLongOperation.StartOperation executes, returning the same list back to the framework causes Acumatica to treat those records as still pending for processing, which results in the action being triggered repeatedly and the success dialog appearing in a loop.

To fix this, update the return statement. Replace:

return adapter.Get();


KrunalDoshi
Varsity III
Forum|alt.badge.img+1
  • Varsity III
  • April 20, 2026

Hi ​@mcoral62,

So just want to understand that on processing screen, you need Process, Process All and a custom action? I believe, you might not need the custom action unless you want to do something specific which Process/Process All button cannot handle. 

You can always change the caption of Process/Process All buttons by using Set..Caption property in your constructor of Processing screen.

<YourDataView>.SetProcessCaption("Process");
<YourDataView>.SetProcessAllCaption("Process All");

Rest you can handle in your delegate by using SetProcessDelegate method and no need to return anything.

<YourDataView>.SetProcessDelegate(<YourDelegateMethod>);

Hope this helps.