Domain separation is the technique by which we let users view only a selective range of data. The data visibility is defined by the domain in which the user is residing and we add a similar column to our concerned table as Domain. The filtering is done by ServiceNow by matching the domains and letting a user view only the data that falls into his domain,
For this, what we may do as an advanced step is separating the users based on their company and adding a Company field in our table which will decide the domain view. I'll tell you how!!
First, create a column named domain....do not save before you read this fully. Column type will be Domain as well. Change the column name from u_domain to sys_domain before you save anything.
After you'll save, ServiceNow will create a column named Domain Path for its reference. Now, all you need to do is convert your Company name to Domain. For this, we will be writing a Business Rule which will run before Insert and Update.
Below is the script you need to add in Advanced tab -
var defdomain = current.u_company; //the value from company field - sys_id since it is a ref field
var chgdomain = ""; //variable to store domain value
var compcheck = new GlideRecord('core_company');
compcheck.addQuery('sys_id', defdomain); //find the record of the company
compcheck.query();
if (compcheck.next()) {
chgdomain = compcheck.sys_domain.getDisplayValue(); //get the domain value from company table
}
updatesoftdomain();
function updatesoftdomain()
{
current.sys_domain = chgdomain;
current.update();
}
Done Done Done...!! :)
Great Article. its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
ReplyDeleteservicenow online course hyderabad
ServiceNow provides comprehensive lifecycle management of Amazon resources. Incorporate Amazon offerings into your enterprise service catalog, integrate AWS Config with the ServiceNow CMDB, and manage usage and costs of Amazon resources at the application, service and cost center levels. Implement efficient incident, problem and change management of services deployed through AWS CloudFormation.
ReplyDeleteGood article.It is very useful for all of us.more interesting from the starting lines until the end.
ReplyDeletehttp://www.calfre.com/India/Hyderabad/ServiceNow-Training/listingcity
ReplyDeleteUsually I never comment on blogs but your article is so convincing that I never stop myself to say something about it. You’re doing a great job Man, Keep it up.
mobile phone repair in Auburn Hills
iphone repair in Auburn Hills
cell phone repair in Auburn Hills
tablet repair in Auburn Hills
ipad repair in Auburn Hills
mobile phone repair Auburn Hills
iphone repair Auburn Hills
cell phone repair Auburn Hills
phone repair Auburn Hills
tablet repair Auburn Hills
cheap hidden cameras
ismartalarm camera
dymo label maker
Waterproof Action Camera
Coleman full size air mattress
womens cotton long johns
APPLE WATCH SERIES 3 INFORMATION
Winter Cycling Jackets For Men
Thanks for sharing valuable information and very well explained.Keep posting.
ReplyDeleteservicenow online training
best servicenow online training
Very Nice article,Thank you for Your valuable info.
ReplyDeleteKeep Updating..
Servicenow Developer Training
Servicenow Admin Training Online
I’d need to examine with you here. Which isn't one thing I normally do! I get pleasure from reading a publish that can make individuals think. Additionally, thanks for allowing me to remark! app entwickeln berlin
ReplyDeleteWow, marvelous weblog layout! How lengthy have you been blogging for? you made blogging glance easy. The full glance of your web site is wonderful, as smartly as the content! app entwickeln berlin
ReplyDeleteThanks for sharing valuable information
ReplyDeleteServiceNow Developer Training
ServiceNow Training in Ameerpet