Workspace - Refreshing page after catalog item submission

Jonathan Monks
Tera Guru

I have created a custom workspace and created a new page from scratch.

 

On the page I have added a single catalog item and linked to it by the sys_id. So far, so good. It loads as you would expect.

 

When submitting the catalog item (clicking the submit button) the button changes to be greyed out, suggesting submission. It does submit the catalog item. However, the page remains stuck like that. It doesn't redirect to the new record or (and ideally) just refresh the page.

 

I tried using the "Request generated" event mapping and used "Open page or URL". This does open the other page, however it doesn't refresh the form and remains with the variables populated.

 

How can I get this just to update the form? I.E. submit, then its as if its a fresh page again?

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

5 REPLIES 5

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.