Help me. I have a button in my App and i want a certain page to open on click
Application Type
Traditional Web

I have five pages in my application: 

1. Sales page

2. Report page

3. Audit page

4. Analysis page

5. sales detail page

And I have a button on sales detail page that saves data inputted on click and also leads to a certain destination depending on what the user has inputted into the sales detail form.

On click of the button , I want report page to open

On click of that same button, I want Audit page to open

On click of that same button, I want Analysis page to open

The choice of page to open will depend on what the user has inputted on the sales detail page.

Please, guide me on how to do this. Thanks as always.

As I have used the Form widget on the screen, so I have set this condition in the expression just, for example, you can set your condition here.

Hello Harrison, why not use a switch, to go to a destination depending on the input. With the switch, it's "easier" to do conditions with your variables, and depending on those conditions you can put to go to a destination.
Also! if you want to go to a destination and its, not on the same module, you can use too the external URL


Kind regards,

Márcio 

Hello, thanks for your response. Could you explain future as i have never used switch function in the past. Give step by step guide on how to go about switch function. Thanks

As you can see the switch works like this, you have a condition for each direction, in this case, I just inserted one condition, where if condition=1 it goes to the AuditPage.

Remember, the screen action must receive input, and then inside of the screen action, you are going to use it to see to which screen you go.

I am going to finish this solution and send it to you.

Regards,

Márcio

Here you have the solution explaining, how it works.

You can play here too: where you can put on the input 1 or 2 or 3 and will send you to a screen. See the oml and the screen action and you will understand :)

https://marcio-carvalho4.outsystemscloud.com/switch/Entry1.aspx?_ts=637602193587842906

Kind Regards,

Márcio

switch.oml

Hi Harrison,

You can create a static entity and add the list of the pages as records. So, when you click the submit button on Sales details page and pass the entity ID of that page which have been selected on screen to open the another page. 

In this way when you have some more new pages to be added into the future you just need to add a new record into the entity and no further code changes would required to open the new pages.

Thanks & Kind Regards,

Sachin

Hello, thanks for your response. Could you kindly give me step by step guide on how to go about passing the page id please. Thanks

Could you please let me know the criteria you are using on the Sales Details screen to open the different pages? 

Hi @Harrison 

You can add "New screen action" in the properties of the "sales detail page" button, and in that screen action you can add switch widget, and there give the condition and destination page according to your need.

Thanks & Regards,

Supriya

Hello, thanks for your response. Could you explain future as i have never used switch function in the past. Give step by step guide on how to go about switch function. Thanks

Thanks, but could you kindly guide me on how to set the condition for the connectors in Expression Editor please.

mvp_badge
MVP

Hi Harrison,

I'm sorry, but if that's not something you can work out yourself, then perhaps you should not try to make apps this (relatively) complex. This is very basic programming, and very basic OutSystems.

As I have used the Form widget on the screen, so I have set this condition in the expression just, for example, you can set your condition here.

Thanks to everyone that contributed to the solution. Special thanks to Supriya Bawali. Your explanation enable me to arrive at the solution


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.