View rule script is working only on "default" view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 02:48 AM
Hi all,
we implemented View rule with script (we are running Helsinki) for sc_req_item table.
But we realized, the view rule is working only on "default" view. So in case sc_req_item table is using view "mobile", the View rule does not apply.
It does not make sense for me. Is it a bug or "feature". Why is scripted View rule working only on "default" views? This is totally unuseful...
Or did we miss something? There is almost nothing in official documentation about View rule script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 03:16 AM
Is this line correct answer = null; ?
Shouldn't this be answer = ''; ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 03:25 AM
I think it does not matter, but I tried. Still not working.
The gs.log should run regardless of the value in "answer".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2017 12:36 PM
Hi Peter,
While searching community for view and view rules, came across your question.
Hope you have figured it out
(function overrideView(<view name>, is_list) {
gs.log('PETER TEST', 'Peter');
answer = <view name>;
})(<view name>, is_list);
Thanks
Tez

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 09:12 AM
Hi Peter,
I had the same issue with the view rule script not working as I expected.
I believe that the problem is with the glide.ui.remember_view property setting. If this value is set to true, then your view rule script will only run if the user does not have already have a view preference. If you set the value of the property to false, then your script will run each time.
I've attached an update set with a simple view rule and module for running it. The module opens the sc_req_item table with a view of ess.
The view rule, sets the view to default.
The updateset sets the glide.ui.remember_view property to false.
To test do the following.
- Install the update set.
- Go to the new RITM Test View Module.
The view will be set to default. - Try to change the view.
You will not be able to change it.Note: That you will be able to see the different views, but when you try to switch views, the view will not change. - Check the log for a message that starts with XXXXXX, You will find a message XXXXXXXXXXX ess
- Change the value of the glide.ui.remember_view sys_properties record to true.
- Repeat steps 2 and 3.
You will be able to change the view. - Check the log.
There will not be a new log message that starts with XXXXX
Good luck, I hope this helps.
Thanks,
Cody
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 01:08 PM
This is great ! Thank you, your solution helped me !!