Skip to main content
Question

Launching an external url from mobile

  • October 3, 2024
  • 5 replies
  • 143 views

Tony Lanzer
Pro III
Forum|alt.badge.img+2

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?

5 replies

hdussa
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • October 4, 2024

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
}

 


Tony Lanzer
Pro III
Forum|alt.badge.img+2
  • Author
  • Pro III
  • October 4, 2024

@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!


hdussa
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • October 9, 2024

Hello @Tony Lanzer ,

Please let us know if the solution worked. Thanks!


Tony Lanzer
Pro III
Forum|alt.badge.img+2
  • Author
  • Pro III
  • October 23, 2024

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.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • January 14, 2025

Hi ​@Tony Lanzer were you able to find a solution? Thank you!