- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-10-2021 09:04 AM
This will be a short, simple, and hopefully useful article on how to create a shortcut to a record producer or catalog item on the Agent workspace so that fulfillers can access it quickly for frequently used requests. For this demo I will walk through adding the OOTB “Report Outage” Catalog Item to the list view on the HR Agent Workspace so HR Agents can quickly report an outage on one of their applications.
- Start by making sure you are in the right scope for whichever workspace you are using
- You’ll also need to grab the system ID of the Record Producer you want to add to the Workspace
- Next you will navigate to the List Action menu for the Workspace
- Click “Create New”
- Fill out the following:
- Action Label – This will be the display value for the button that will be created
- Action Name - internal name for the List Action
- Implemented As – Set this to Client Action
- Button Type – Primary
- Workspace – Set it to the Workspace where you want to add the button
- Table – Any workspace list views for this table will have this button available.
- Here is what your form should look like at this point.
- Next we need to add a Client Action
- Click the look up icon in the “Specify client action” field
- Create a New Action Payload Definition when the new window opens.
- Fill out as follows:
- Key = ITEM_SELECTED
- Label = Same as Action Label from 5a. (Mainly for recordkeeping and easier maintenance, you can really call it anything)
- Applicable To = List
- Payload = {"table":"sc_cat_item","row":{"sys_id":{"value":"<sys_id of Record Producer>"}},"parent_table":"{{parentTable}}","additional_data":{"query":"{{query}}"}}
- Description = Added for additional context
- Your form should look like this.
- Click Submit
- You’ll be directed back to the Action record you created earlier
- Save the Action
- After saving the You will see the new list action on the workspace list you specified.
That’s all there is to it! Hope this was useful.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This is not working, the button is not showing up when followed the same steps, any help appreciated
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I followed the suggested steps, but when I clicked on the button, record producer is not getting opened.
When I check the console, I could see this error 'the resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally'. Used Client Action 'Create Catalog Item' is OOB one.
Any suggestions?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This is not working in Yokohama is this solution still relevant on the new versions?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@keithl22 is there an updated payload or something else that needs to be done to get this to work in Yokohama with a UXF Client Action? I'm trying to open a Record Producer from a button on the Project Workspace. Following the above I can see a button, but it doesn't do anything.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
the button is visible but it doesn not redirect to the record producer
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I found a workaround to this approach that works in Yokohama. Create a UI Action instead of a Declarative Action. I guess I assumed from this post that UI Actions no longer worked in workspaces, replaced by Declarative Actions, but it seems to be more like Declarative Actions are supplementing UI Actions. Overall the transition to configuring workspaces is monumentally more difficult than it needs to be due to the schizophrenic nature of the cobbled-together architecture, and the lack of helpful documentation and posts that actually work several versions later.
In any event, my example is on the Project Workspace, but I would think the same approach might (?) work elsewhere. I can't seem to post screenshots anymore, but the UI Action is in the Global scope, empty except for the Name, table, active, Show update, Client, and List v2 Compatible. Check Form link if you want this to appear in a menu in the workspace, and on the Workspace tab, check Workspace Form Menu and Format for Configurable Workspace. If you want a button instead, leave Form link unchecked, and on the Workspace tab check Workspace Form Button instead.
Here is my script, which launches the Catalog Item in a separate browser tab - basically just give it the URL of launching the item manually. In my case I'm also adding a parameter to populate a variable with the current project.
function onClick(g_form) {
//var url = 'com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=378b2325c397bad0676a07f9d0013172&sysparm_v_project=' + g_form.getUniqueValue(); //Catalog Item
var url = 'now/nav/ui/classic/params/target/com.glideapp.servicecatalog_cat_item_guide_view.do%3Fv%3D1%26sysparm_initial%3Dtrue%26sysparm_guide%3D988fc596c35f3e14676a07f9d001312d&sysparm_v_project=' + g_form.getUniqueValue(); //Order Guide
open(url);
}
As the comments suggest, the first version was working for a Catalog Item, then I switched to an Order Guide, which is the second url value.
To populate the variable on the Catalog Item from the url parameter you need a script like this:
function onLoad() {
//Populate the variables with the parameters passed in the URL
//Use the 'getParmVal' function below to get the parameter values from the URL
//UI Action passes in project in sysparm_v_project
var project = getParmVal('sysparm_v_project');
function getParmVal(name){
var url = document.URL.parseQuery();
if(url[name]){
return decodeURI(url[name]);
}
else{
return;
}
}
g_form.setValue('v_project', project);
}
