15
Views
4
Comments
Solved
How can I get URL orign in redirect?

Hi.

I need a little help. I have this scenario.

I have two applications, the application A begin the process, the application B do something and after that return to application A. For example:

The user fill a client form, submit and is redirect to application B. In the application B put complementary data and after that return to application A to see a summary.

My question is, how can I get the URL of application A when I enter in application B? Is there some function that to do this? I need this because when I return to application A I need the URL.

My English is not so good, so I'm sorry for any sentence problem.

Thanks for all!

Rank: #68
Solution

Hi Angelo,


Ok, so your problem is to get to know the domain in which you are.

This is available on the OutSystems meta model on the table Parameter from System. If you filter by Name = 'DefaultDNSName', the field Val has your domain (e.g. example.outsystemsenterprise.com).

You can pass it as a parameter to your C# code and in this way you will have the domain you are, independently of the environment you are.


Hope it helps.


Regards,
João

Rank: #68

Hi Angelo,


If you know exactly the screen from screen A you want to go from applocation B, you can use the action GetEntryURL action from HTTPRequestHandler, which gets you the URL given the espace, screen and parameters.


If the URL from application A is not always the same, there are several ways you can do this:

  • Pass the parameter when going to application B and use the same parameter when coming back to application A;
    • Advantage: no extra data needs to be saved;
    • Disadvantage: it can be tampered since it goes in the URL.
  • Save in a session variable the URL right before going to application B and use it when you come back to application A;
    • Advantage: it can't be tampered since it goes in the URL
    • Disadvantage: You can have a problem using the same application in multiple tabs since you just have one session variable;
  • Save in the database right before going to application B and retrieve it when you come back to application A;
    • Advantage: Secure and robust;
    • Disadvantage: you're introducing more queries to the database (one to write, the other one to read).


It depends on the use case which one is the best solution for you, each one has its advantages and disadvantages.


Cheers,
João

Rank: #68
Solution

Hi Angelo,


Ok, so your problem is to get to know the domain in which you are.

This is available on the OutSystems meta model on the table Parameter from System. If you filter by Name = 'DefaultDNSName', the field Val has your domain (e.g. example.outsystemsenterprise.com).

You can pass it as a parameter to your C# code and in this way you will have the domain you are, independently of the environment you are.


Hope it helps.


Regards,
João