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 07:44 AM
I think the condition should revers because "Not Available For" applied when its condition it true
so change the return value.
answer = false; // false means not avialble for condition not applied
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 = true; // condition applied
}
}
-Thanks,
AshishKMishra
Please accept solution and mark helpful if it helps you
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 08:33 PM
try this
var contactRef = gs.getUser().getCompanyID();
var accountGr = new GlideRecord('customer_account');
accountGr.addQuery('sys_id', contactRef);
accountGr.addQuery('u_case_creation_allowed', true);
accountGr.query();
answer = accountGr.hasNext();
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 05:31 AM
Hi @gagan12 ,
You can create user criteria and configure the record produce for "Not Available For"
-Thanks,
Ashish
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
