Ankur Bawiskar
Tera Patron
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-10-2024 09:00 PM
You can invoke a record producer on click of UI action in Configurable workspace and send parameters to it.
The parameter can also be parsed and fetched using an onLoad catalog client script.
The record producer will open in a new tab in configurable workspace in same window and agent can work and submit the same.
Example:
UI Action: Ensure Workspace Form Button and Format for Configurable Workspace is marked as True
Workspace Client Script:
function onClick(g_form) {
var params = {};
params.sysparm_sysId = 'Your Value Here'; // send the value to be fetched
g_service_catalog.openCatalogItem("sc_cat_item", "catItemSysId", params); // give here the catalog item sysId
}
Then use an onLoad catalog client script to get the parameter value
function onLoad() {
var url = top.location.href;
var urlParameterValue = '';
if (url.indexOf('cwf/agent') > -1) { // check if it's configurable workspace
var url_cwf = decodeURIComponent(url);
var workspaceParams = url_cwf.split('extra-params/')[1]; //Split off the url on Extra params
var allParams = workspaceParams.split('/'); //The params are split on slashes '/'
//Search for the parameter requested
for (var i = 0; i < allParams.length; i++) {
if (allParams[i] == 'sysparm_sysId') { // give here the name of parameter to fetch
urlParameterValue = allParams[i + 1];
}
}
alert(urlParameterValue);
}
}