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.

Workspace UI action

monika94
Kilo Guru

Hi All,

I have a requirement to create UI action in workspace. E.g "Create task" UI action will be on Case table. When clicked on it; it should open a Task table form in a pop-up window. On this window, I want to set current case number as a parent. How can I achive this?

 

Thanks,

Monika

 

 

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @monika94 

Instead of entire form in Pop-Up you can open the form in Sub-Tab  of workspace. Try the following workspace UI Action script.

 

function onClick(g_form) {
    var case_sys_id = g_form.getUniqueValue();

    g_aw.openRecord("sn_customerservice_task", "-1", {
        "query": "^parent=" + case_sys_id
    });
}

 

AnveshKumarM_0-1695716906789.png

 

AnveshKumarM_1-1695716918753.png

 

Thanks,
Anvesh

View solution in original post

3 REPLIES 3

AnveshKumar M
Tera Sage
Tera Sage

Hi @monika94 

Instead of entire form in Pop-Up you can open the form in Sub-Tab  of workspace. Try the following workspace UI Action script.

 

function onClick(g_form) {
    var case_sys_id = g_form.getUniqueValue();

    g_aw.openRecord("sn_customerservice_task", "-1", {
        "query": "^parent=" + case_sys_id
    });
}

 

AnveshKumarM_0-1695716906789.png

 

AnveshKumarM_1-1695716918753.png

 

Thanks,
Anvesh

Hi Anvesh,

I need to open specific view if the task table. that is the reason I was using g_modal.showFrame. How can I open specific view using g_aw.openRecord()? Also I need to glide different table and set that value on task. Can I use GlideRecord in this script section?

Hi @monika94 ,

As this is Workspace it will open the form in WorkSpace view only.

Thanks,
Anvesh