Set Domain of a record in UI Action

thisisauniqueus
Giga Expert

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

9 REPLIES 9

Abhinay Erra
Giga Sage

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();


your help is much appreciated. I tried the snippet above but same result, the record is getting assigned to default domain


Abhinay Erra
Giga Sage

What is the domain value of the current record?


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?


nope false positive the issue is still there