Redirection and Dialog in Acumatica

Hi All,

In the web application is mostly one-way communication – Browser send request, server receives it and response. This means

  • If we don’t use a special technologies like a Web Sockets, that there is no way for server to communicate tho the browser
  • Also if we don’t really know where is the user and if he still will interact with us.
Acumatica Browser Communication

So here we have 2 major questions:

  • How to return control to user when server logic needs it?
  • Prevent data further data modifications? For example if dialog is required when user clicked save.

In Acumatica we have solved these problems with exceptions. When we need to rise a message, we just simple throw a special type of exception, that prevents operation from execution and return control back to user.
After user respond, we can repeat the same call and pass there a dialog answer.

Acuamtica Redirection and Dialogs

The diagram above briefly explains how does it work:

  1. User Triggers Action
  2. Browser sends request to the Acumatica sever
  3. Acumatica server identifies that we need to show dialog and throw an exception
  4. Acumatica core gets this exception and return a special response back to browser.
  5. Browser shows dialog and waits for user reply
  6. Reply sends back to Acumatica with the previous data, so we can repeat operation
  7. Acumatica server completes the operation.

In Acumatica we have a lot of exceptions like this:

  • PXRedirectRequiredException – redirects user to the different screen
  • PXPopupRedirectException – shows different screen as a popup
  • PXReportRequiredException – redirects user to the different report
  • PXRedirectWithReportException – this is combination of first and third exceptions – it can an redirect and open a report together
  • PXRedirectToUrlException – redirects user to the 3rd party url.
  • PXDialogRequiredException – shows a dialog with questions/answer
  • PXRefreshException – simple refreshes the current screen. Useful when settings are changed.

Hope it helps!

2 Replies to “Redirection and Dialog in Acumatica”

  1. Hi Sergei, may you please advise why the following code is not executing. No page is displayed when I pass dynamic URL, however, if I hard-code the URL it works

    private void openUrl(string url)
    throw new PXRedirectToUrlException(url2, “XYZ: 3D – Payment Authorisation”);

Leave a Reply

Your email address will not be published. Required fields are marked *