Open pop up in workspace using UI action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 02:11 AM - edited 12-04-2022 02:27 AM
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 :
Can anyone guide me, how can I achieve this.
cc: @Ankur Bawiskar @kamlesh kjmar
Thanks is advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 03:47 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 10:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 02:13 AM
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
- 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¶m_zpage=0&sysparm_workspace=true¶m_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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2022 04:25 AM
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