Set Domain of a record in UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 12:26 PM
Hi
I am creating a Demand record from Problem on click of an UI Action. The issue is the resulting demand record is created in the default domain always, where as i want it to be created in the customer domain. In the script i have something like
...
demand.setValue("sys_domain", current.sys_domain.sys_id);
demand.setValue("u_affected_domain", current.u_affected_domain);
...
where current problem record is in the customer domain.
Please guide me what im missing here
Regards
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 02:01 PM
Try this
var demand = new GlideRecord("dmn_demand");
demand.setValue("sys_domain", current.getValue('sys_domain'));
demand.setValue("u_affected_domain", current.u_affected_domain);
demand.priority = current.priority;
demand.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 02:14 PM
your help is much appreciated. I tried the snippet above but same result, the record is getting assigned to default domain

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 02:15 PM
What is the domain value of the current record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 02:21 PM
the current record is in the customer domain.
i added the customer domain to my test user's visibility domain and the record was created in the customer domain without manually assigning the domain id. does visibility domains had something to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 02:26 PM
nope false positive the issue is still there