How to create pop up in work space

jui
Tera Contributor

Hi All,

I have one requirement I just want to create one Pop Up in agent work space in related list so user don't want to click on new button and new page they just want to click on the related list and they want to add all field witch is visible in that form .let me know how to do it. kindly find below screen snap for more understanding.

jui_0-1744103427051.png

 

 

 

1 REPLY 1

swapnali ombale
Kilo Sage

@jui 

 

  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, {});
        }
    });

}