Is there a way to know, inside a screen action, which web screen called the current web screen (where the action is being performed). I have a screen that can be called from various different places in my web application. It has several buttons, each with its own functionality, calling a local screen action. I would like have a target destination as the final node in a screen action that goes back to the calling web screen. Currently I have a lot of if statements and it's messy. Especially as there are (a lot) more of these seperate callers coming.

Hello Chris,

You have the GetReferrer from HTTPRequestHandler extension.
https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/HTTPRequestHandler_API#GetReferrerURL

Just be carefull that ANY request from inside the page will make it return the page itself, so you may want to store the result locally on preparation, and do this ONLY if the page is being "loading" (I think the function is called IsPageLoad or IsPageLoading, don't remember right now).

Cheers.

Chris Laurie wrote:

Is there a way to know, inside a screen action, which web screen called the current web screen (where the action is being performed). I have a screen that can be called from various different places in my web application. It has several buttons, each with its own functionality, calling a local screen action. I would like have a target destination as the final node in a screen action that goes back to the calling web screen. Currently I have a lot of if statements and it's messy. Especially as there are (a lot) more of these seperate callers coming.

What I'm using without any issues is the method GetURLWithSession().

There is the GetURL() method too that is the same thing without the session info, but I do prefer to use the GetURLWithSession().

Implementation is quite easy:

- In the current web screen create a Text variable (PreviousURL for example) and set it mandatory.

- Also in the current web screen, in buttons or destination at the end of a Screen Action, you set the OnClick Method property to Navigation, the Destination property to Common\ExternalURL and the URL property to ReplaceURLDomain(PreviousURL).

- In the caller screen you write GetURLWithSession() or GetURL() as value of the PreviousURL parameter of target screen, inside Link properties.

To enable GetURLWithSession() or GetURL() you will have to manage dependencies and look for the HTTPRequestHandler producer, where the methods will be available to import.