Skip to main content

I have code that opens a new tab to an external URL like this (builder.Uri is just referencing a url):

throw new PXException($"Redirect0:{builder.Uri}$target=_blank")

This fails on mobile. I assume maybe because the mobile browser doesn't recognize it? If so, does anyone know how to launch an external web app from the Acumatica mobile app?

Hello @Tony Lanzer ,

 

Assuming this external URL is from an action, did you try mapping the action and setting the Redirect attribute to True?

add recordAction "ViewOnMap" {
behavior = Void
redirect = True
}

 


@hdussa, It originates from an action, correct. However, it does more than redirect. It needs to build a token with a client secret, and build a URL with parameters. The action method currently calls multiple other methods.  I guess I could try moving the redirect line up the call stack to the actual action method and give that a try with what you suggested. I’ll report back whether that works. Thanks for the suggestion!


Hello @Tony Lanzer ,

Please let us know if the solution worked. Thanks!


I ended up changing the redirect to this:
 

throw new PXRedirectToUrlException(uri.ToString(), PXBaseRedirectException.WindowMode.New, string.Empty, false);

and also added your suggestion to the mobile MSDL. It no longer errors on mobile but it appears to open a new Acumatica instance “window” instead of the external URL.


Reply