- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2020 01:05 AM
Hi There,
I have written Before Query Business Rule on Incident table to sort 'caller_id' field for list view. It is working fine but I want this code should only execute for related list.
For Example: Shorting should only apply to related list records (Problem -> Incident), not to incident table's related list records.
Below are the code:
(function executeRule(current, previous /*null when async*/) {
gs.getUser().savePreference('incident.db.order','caller_id');
gs.getUser().savePreference('incident.db.order.direction','ASC');
})(current, previous);
I tried with RP.isRelatedList() , but no luck.
Any lead will be appreciated.
Regards,
Abhishek
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2020 12:22 AM
Add this condition to you business rule and then it will run only where incident is used as related list.
JSUtil.notNil(GlideTransaction.get().getPageName()) && !(GlideTransaction.get().getPageName().endsWith("_list")) && gs.tableExists(GlideTransaction.get().getPageName()+"")
-Tanaji
Please mark reply correct/helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2020 12:49 AM
Good to know. Haven't tried this yet. I always assumed that the sort order of records on a table propagated throughout the instance regardless of view.