The Zurich release has arrived! Interested in new features and functionalities? Click here for more

how to set values using UI action for agent workspace

Josh11
Tera Contributor

I have created a UI action to create a Normal change from incident form on agent workspace, the UI action works fine. But I want to set value on incident with new change created and associate the change with incident from which change created.

Below is the code which is used workspace client script

 

function onClick(g_form) {


var result = g_form.submit('create_normal_chg_ws');
if (!result) {
return;
}
result.then(function() {


var params = {};
params.sysparm_parent_table = "incident";
params.sysparm_parent_sys_id = g_form.getUniqueValue();
params.rfc= g_form.getUniqueValue(); //set change on incident
g_aw.openRecord('change_request',-1,params);

});
}

 

with the help of params nothing is set for fields but I can see these values on URL.

 

Any help much appreciated

6 REPLIES 6

eagle18
Tera Contributor

@Josh11 if I have this correct, it sould be the same as a normal ui action but will need to enable the UI action via the workspace form button

 

There's an in-depth article on workspace UI Actions 

 

https://www.servicenow.com/community/next-experience-articles/how-to-use-ui-actions-in-workspaces/ta...

eagle18
Tera Contributor

Hi @Josh11 This should be the same as a standard UI Action but need to enable the action via  the workspace form button 

https://www.servicenow.com/community/next-experience-articles/how-to-use-ui-actions-in-workspaces/ta...

Josh11
Tera Contributor

Gone through it but no option shown how we can pass values or set values 

newhand
Mega Sage

@Josh11 

params  is not used for setting values to the record(from the snow documents)。

It can only set below options.

"params": {
  "readOnlyForm": Boolean;
  "defaultTab": "String";
  "hideDetails": Boolean
}
Please mark my answer as correct and helpful based on Impact.