Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Domain separation

vinod6
Tera Contributor

In incident table i have a field called start date. Domain A user is updated this field then Domain B users this field is  not editable(read-only.) Please provide a acl script or UI Policy script for this. It is help full.
Thanks! 

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @vinod6 

In the UI Policy, you need to select the domain so that users from that domain cannot update the field or it becomes read-only.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

MaxMixali
Tera Guru
Hope that can help
 
 
// Get the domain of the record
var recordDomain = current.sys_domain;
 
// Get the domain of the logged-in user
var userDomain = gs.getUser().getDomainID();
 
// Allow write if user is from the same domain (Domain A)
if (recordDomain == userDomain) {
    // Additionally allow global domain users
    return true;
}
 
// Otherwise block write
return false;
 
 
NOTE:
Domain A users can edit start_date on Domain A records
Domain B users cannot edit the same field because the record belongs to Domain A
It automatically handles Global domain users (if needed)