Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Redirecting to another form not working in workspace

gillerlaraj
Tera Contributor

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
Tera Sage

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