How to access the field value in a view rule script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2017 05:13 AM
Hi
We need to get a field value in a view rule script.The current object is not accessible from it.we did try with business rule as well but it didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2017 06:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2018 04:10 AM
I see this post is a few years old and you might already have a solution for this. Otherwise you can access the current record like this from a View Rule, just replace table_name and field_name:
var url = gs.action.getGlideURI().getMap();
var sysId = url.get('sys_id');
var gr = new GlideRecord('table_name');
if (gr.get(sysId)) {
gr.field_name;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:52 AM
Johan you are my hero! This is just what I needed. Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 04:12 PM
Found this on another thread.
Navigation handlers (sys_navigator) can be used for scripting view rules - the handler script has access to the current object