Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Workspace - How to add a specific catalog item to a workspace

Jonathan Monks
Tera Guru

I am sure I'm missing something obvious here but hoping you can help.

 

I have a particular catalog item which I want to add to a custom workspace. I have added a page to the workspace and used the "catalog item" option from the content.

JonathanMonks_0-1768471640024.png

 

On the right, I set the sys_id for the one that I wanted. This then loads the form appropriately on the page.

JonathanMonks_1-1768471688902.png

JonathanMonks_2-1768471725993.png

The issue comes when I submit the catalog item. It works - the workflow does process and finish, the request is created fine. The form, however, hangs. You can see the submit button is now greyed out, but it never moves from there.

JonathanMonks_4-1768472251359.png

 

As I mentioned, I'm sure I'm missing something obvious. Am I missing the right method of doing this?

 

I have tried adding an event handler to move it to a record form after (which I don't really want) instead and also added a client script in that refreshes the form. The refresh works (it just refreshes the page) but it comes with the issue of generating hundreds of instances of the associated workflow.

 

1 ACCEPTED SOLUTION

Jonathan Monks
Tera Guru

Thanks for the replies - this is what I ended up going with. On the catalog item you need refreshing upon submit, create an onSubmit catalog client script.

function onSubmit() {

    // Alert user the form has been submitted.
    alert("This has been submitted and the page will now refresh.");

    // Refresh the form after submission
    setTimeout(function() {
        location.reload();
    }, 1000); // Adjust the timeout value as needed
   
}

This will then show a message that its been submitted, and refreshes the page.

View solution in original post

14 REPLIES 14

Yes, but once the catalog item is added to the workspace, clicking Submit does nothing. The button just becomes greyed out and no request is generated.

 

Not sure what to suggest there then I'm afraid. Might be worth having a look at any logs that it creates (or maybe even the console in your browser) to see if any errors get displayed, but from my perspective it was just adding in that client script and it worked.

 

One thing to note though, I did check the box for "Isolate script" in the client script (which I realise now I didn't add to my solution) - however in my case it was creating the request so I don't know if this will do it for yours. Worth a try though.

Servicenow support: I've been able to replicate our issue in out of the box Zurich, even with UI Builder plugin version 28.2.75. The "order now" or "submit" button of the "Catalog item" component was working in Yokohama -- even without opening a new page for the created record, the Request and requested item records are still generated. This doesn't happen in Zurich.


I have created a Problem PRB1999937to have this issue investigated and addressed by development. If there are any available workarounds, I'll also let you know.

Please feel free to add any questions here and we will provide updates as we progress with the issue.

Hi Emy,
Any luck finding a solution for this?