Skip to main content

Hi, I am currently trying to throw a redirect to report exception in a customization project. But because I need the page to refresh as well as the new page to be thrown, the exception needs to be thrown in another thread to not interfere with the return value of the function. 

The function is as follows:

public delegate IEnumerable PrintInvoiceDelegate(PXAdapter adapter, String reportID);
>PXOverride]
public IEnumerable PrintInvoice(PXAdapter adapter, String reportID, PrintInvoiceDelegate baseMethod)
{
PXLongOperation.StartOperation(Base, delegate ()
{
//Calls the stock print method of SO303000 which will throw a report redirection in new tab
baseMethod(adapter, reportID);
});

//I want the function to still return because I want the page to refresh and show the updated information
return adapter.Get();
}

 

1. Before calling print action

 

2. PXLongOperation success

 

3. After complete, page refresh and files now shows that a new file has been attached

 

My question is, I can’t figure out why there is no success message of the PXLongOperation pop-up (as seen in the second image). Second question just out of interest, is there another way of doing this, as in to throw a redirect exception and refreshing the current page to reflect up-to-date information?

Any insight and help would be invaluable, thanks. 

@naufal58,

You can try something like below to show the long operation success message,

  • throw new PXOperationCompletedException(String.Join("", "Created Bank Receipt"));

You can add it after executing your logic or after throwing the redirect. I hope that helps, thanks.!


Reply