- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 12:15 AM
Hi Team,
How to restrict a newly created custom view only on existing records not on new Record( form view) on resource form
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 07:59 AM - edited 01-15-2024 08:00 AM
Hello @Ramu8 ,
try below code in your view rule script to check if the current record is new or existing based on that you can hide the view.
var uri = gs.action.getGlideURI();
var sysId = uri.get('sys_id');
if(sysId != '-1'){ // if the sys_id is not "-1" then the record is existing record.
answer = 'view_name';
}
Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 07:05 AM
Thanks for response but it is working only when we use conditions and here i am using advance script in which based on group we are configuring view rules
current object is not supporting and also operation==insert is not supporting so please suggest if any other possible way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 07:59 AM - edited 01-15-2024 08:00 AM
Hello @Ramu8 ,
try below code in your view rule script to check if the current record is new or existing based on that you can hide the view.
var uri = gs.action.getGlideURI();
var sysId = uri.get('sys_id');
if(sysId != '-1'){ // if the sys_id is not "-1" then the record is existing record.
answer = 'view_name';
}
Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.
Regards,
Siddhesh