36
Views
12
Comments
Navigation

Hi,

I want to know how we can navigate to the last visited screen. 

Suppose I have four screens in my application. The first is a home screen that displays a table widget. In one of the table columns, I place a navigation link. When I click on that link, it takes me to the second screen. On this second screen, there's a button that, when clicked, navigates to the third screen. If I return to the home screen and click the link in the table column again, I want it to navigate directly to the last visited screen, which is the third screen, instead of the second screen. How can I implement this functionality? 

2024-01-04 09-21-21
Venkatesaiya

Hi @Lincy Thomson ,
You can use switch operator to navigate the page based on you condition.

Thanks

UserImage.jpg
Md Mansur

Hi @Lincy Thomson

I have done your Requirement  and attached oml file so please go though this:

Approach :

Create a  New Entitles and store Last URL and Userid and navigate of homepage to others firstly filter Last URL on the basis of GetuserId() and Navigate to this Page  

UI Link:

https://personal-bedrfblj.outsystemscloud.com/Nevigation/homescreen


Thanks

Md Mansur



Nevigation.oml
UserImage.jpg
Lincy Thomson

Hi @Md Mansur ,

I tried this way but it is not taking me to the last visited screen.

UserImage.jpg
Md Mansur

Hi 

I have attached new oml file please go though this:

Logic part:

1. Create a Database for last URL:


2 Store Last Visited Screen logic when you click Application name or Icon Like this:

3.Fiter logic for for ScreenA


Thanks

Md Mansur

NavigationFinal.oml
2024-03-23 18-16-49
Bryan Villalobos

Hi @Lincy Thomson ,


The simplest way to do this is this:

1. Create a ClientVariable where you store the last visited URL. Or maybe just simple integers 2 or 3 to denote the screen number (or you can create static entity).

2. OnInitialize of screens 2 and 3, make sure to assign the correct screen to the client variable created in step 1

3. OnClick of the link in the table, instead of navigating to the second screen, you need to have a switch, or ifelse to navigate to what value the client variable has.


Regards,

Bryan

UserImage.jpg
Lincy Thomson

Hi @Bryan Villalobos

I tried this way too, it is taking me to the last visited screen but the issue is if I have a table with many requests say for eg: request #1,#2. For req #1, If I am on the third screen and come back to the home page, it is taking me to the same screen itself. for req#2 also it is taking me to the third screen. for all the request, it is taking me to the same last visited screen. For each particular request, It should take me to the last visited screen of that request itself. How can I do this



2024-03-23 18-16-49
Bryan Villalobos

I see. 

In that case, instead of using a Client Variable, you need to create a new entity that contains the ReqId, UserId and the LastVisitedURL. Then you need to join this new entity into your existing aggregate. 

On click of the link, you can just get the LastVisitedURL of the current row.

Don't forget to create or update this entity whenever you visit the screens to save the LastVisitedURL of the corresponding request.

Regards

Bryan

UserImage.jpg
Lincy Thomson

Hi @Bryan Villalobos ,

Can you show an implementation example for this if possible

2024-03-23 18-16-49
Bryan Villalobos

Hi @Lincy Thomson ,

I attached a sample oml. You can get the idea from there.

Take note that if you do not need to vary per user, you have to modify the entity to become an extension entity (Id data type is the main request Entity Identifier - one-to-one). You can read more here.

 Also, make sure to apply the development best practices.


Regards,
Bryan

NavTest.oml
2025-02-10 17-24-13
Arun Rajput

Hi Lincy

You can use client variable as suggested by Bryan or you can use  Outsystems built in function ReferrerURL which you can find under the HTTPRequestHandler module.

This function return the last url access by the browser or application.


-Arun

2024-05-14 05-39-17
Jothikarthika - EONE

Hi @Lincy Thomson ,

you can use this script in button onclick action

"history.back(); "

UserImage.jpg
Loi Yih Rong

Halo @Lincy Thomson , the information given by you may not be enough, 

perhaps you can make use of the OS built in "Destination" widget that available in Client Action.

In the widget selection, it have the navigate to "Previous screen" option.

Hope this would help to solve your issue.

Screenshot 2024-08-14 131725.png
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.