Restrict the record producer for all the contact of an account.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 04:37 AM
I want a record producer(say Create Case) to not available for all contact of an Account if a check box (say allow case creation) is uncheck on account record.
Thanks'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 05:30 AM
you can use user criteria with advanced script and then add this in Available for related list of that record producer
1) get logged in user's account
2) query account table with this account and check the flag
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:12 AM
Hi @Ankur Bawiskar ,
Thanks for your response, I am using the below script but even if checkbox (allow case creation) is true then also the user/contact are not able to view record producer(create case).(I want to restrict only when check box is false).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:24 AM
Hi,
What's the default return value of answer in your code.
check the first line , if it's there in your code.
answer = true;
var contactRef= gs.getUserID().account;
var accountGr= new GlideRecord('customer_account');
accountGr.addQuery('u_case_creation_allowed', false);
accountGr.query();
while(accountGr.next()){
if(accountGr.name == contactRef){
answer = false;
}
}
-Thanks
Ashish
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:29 AM
Hi,
after adding 'answer = true', it giving the same response.
I am using this in 'Not Available' related list user criteria and default answer is true.
