Open pop up in workspace using UI action.

Virendra Dwived
Tera Expert

Hi Everyone,

 

I have created UI action in agent workspace to open pop up.

1. When I click on the button then pop up should open with record list of table.

2. And when I click on any record , it's details should get populated in additional notes ( cases ). 

First part of requirement I have achieved, but second part requirement I am not understanding How to get it.

 

UI action : 

0005.PNG

 

 

Can anyone guide me, how can I achieve this.

 

cc: @Ankur Bawiskar @kamlesh kjmar 

Thanks is advance

8 REPLIES 8

Hi @Ankur Bawiskar 

When I open Pop up and I click on particular record . After clicking on record the pop up should destroy and data should be auto populated.

Thanks

Hi @Ankur Bawiskar 

 

Can any approach work in this regard.

 

Thanks

Jack
Tera Guru

hi Virendra,

Because you don't mention about your workspace is customize workspace (WEP) or legacy agent workspace, so I assume this customize workspace. You can try my way:

technique -> broadcast event "message" between iframe and top.window

 

  1. UI Page -> Client script:

 

function callbackParent(v) {
    var _u = new URL(window.location.href);
    _u.searchParams.append("item", v);
    window.parent.postMessage({
        "src": "jcallback",
        "value": v
    }, top.window.location.href);
    window.location.href = _u;
}​

 

  • UI Action -> Workspace client script:

 

function onClick() {
    var i = "",
        url = '/jdump.do?param_table=sc_cat_item&sysparm_clear_stack=true&param_zpage=0&sysparm_workspace=true&param_query=sc_catalogsISEMPTY^active=true';
    top.window.addEventListener("message", function (event) {
        if (event.isTrusted && event.data.src== "jcallback") {
            i = event.data.value;
        }
    }, false);

    g_modal.showFrame({
        url: url,
        title: 'whatever',
        size: 'lg',
        height: "40em",
        autoCloseOn: "URL_CHANGED",
        callback: function () {
           i && g_service_catalog.openCatalogItem('sc_cat_item', i, {});
        }
    });

}​

 

Hope this help!

 

Sebastian L
Mega Sage

Hi,

Have a look at this article: https://www.servicenow.com/community/next-experience-articles/how-to-use-ui-actions-in-workspaces/ta... 

 

The only way I see this done is similar to what @Jack  has suggested up here. Quoted from the article: "Propose Major Incident UI Action is a great resource to see how UI Pages are being called in workspaces."


Best regards,
Sebastian Laursen