- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 09:12 PM
Hi Team,
Is there a way to identify if user has opened a form view or list view ? Just like ,we can check whether user is from interactive session gs.isInteractive() using GlideSystem Method.
Problem Statement:
Actually we have problem with Query BR, which works both on form and list view (Obvious behavior of Query BR)? and it is unnecessary run a query BR on form view to do a complex query, if we are just opening single record. So we would like to update Query BR condition to not to run on form view. Any alternative idea is also welcome in this Problem statement
Regards
Pawan K Singh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 09:44 PM - edited 12-03-2023 10:12 PM
Hi @Pawan Kumar Sin,
Hope you are doing well.
You can try fetching the URL and check if the URL contains "_list". If it returns true, then it should be a list view.
Sample: if(url.indexOf("_list")>-1)
Please mark this response as correct or helpful if it has helped you with your question. 😊
Thanks, and regards,
Anwesha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 09:44 PM - edited 12-03-2023 10:12 PM
Hi @Pawan Kumar Sin,
Hope you are doing well.
You can try fetching the URL and check if the URL contains "_list". If it returns true, then it should be a list view.
Sample: if(url.indexOf("_list")>-1)
Please mark this response as correct or helpful if it has helped you with your question. 😊
Thanks, and regards,
Anwesha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 09:59 PM - edited 12-04-2023 10:06 PM
Thanks Anwesha for an Idea, I tried below script condition on BR, to not to work in form view and it is working.
var runBROnFormView = true;
var currentURL = gs.action.getGlideURI().toString();
if (currentURL.indexOf("_list.do") > -1 ) {
runBROnFormView = false;
}
if(runBROnFormView) {
// Execute Form view Script
}
else{
// Execute List view Script
}
Regards
Pawan K Singh