We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Redirecting to another form not working in workspace

Not applicable

Hi There,

in change form once i change cateory to Telecom it will save the form and redirec to the cmdb_ci_outage form and get the details form change form to autopopulate in cmdb_ci_outage form . 

 

this is the script i have written.

 

Client script:

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    if (newValue == 'Telecom') {
        alert("inside if with sow view");
        gsftSubmit(null, g_form.getFormElement(), 'test');
    }
}
 
--------------------------
ui action:
 
gillerlaraj_0-1732209283013.png

script was:

 

redirecting();

function redirecting() {
    current.update();

    var url = "cmdb_ci_outage.do?sys_id=-1&sysparm_query=";
    url += encodeURIComponent("cmdb_ci=" + current.getValue("cmdb_ci") + "^task_number=" + current.getUniqueValue() + "^short_description=" + current.getValue("short_description") + "^EQ");

    action.setRedirectURL(url);
    action.setReturnURL(current);

}
 
This script was working in Native UI , but it's not working in workspace
 
gillerlaraj_2-1732209411291.png

 

any suggestion pls how to achive in workspace.


 

 

 

Regards,

Rajesh.

1 REPLY 1

Dibyaratnam
Kilo Patron

You have to write Workspace client script in the UI action to get this working on workspace side.