- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 11:44 AM
Hello All,
I am trying to create a script that will give the user a notification onSubmit that they submitted the form correctly and redirect them back to the list view. Simply put, user fills out the form. Clicks submit. They are notified of successful submission and redirected.
Also, what would be best practice? (Business Rule, Client Script, etc.)
Thanks,
Ben
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 11:57 AM
If you want the message to stay on screen even after redirecting the user to list view and user needs to remove the message manually, use After Insert BR and in the Actions tab enter your message.
If you want the message to disappear before redirecting to list view, use OnSubmit client script and use g_form.addInfoMessage("Incident submitted successfully.")
Mark it correct if it resolves your problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 11:54 AM
Hi Ben,
I suggest you do this in Business Rule bcoz a business rule can be triggered either on before/after DB operation, which would mean that all client and server-side validations are completed and data is ready to enter the table.
So you can write after insert BR and in the script, you can call
gs.addInfoMessage("Your form is submitted successfully");
Kindly mark the comment as a correct answer and also helpful if it answers your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 11:56 AM
If you want to do it on specific catalog item you can create onSubmit client script with something like below
function onSubmit() {
g_form.addInfoMessage("Request has been submitted. Please wait....");
top.window.setTimeout(fun2, 50000);
function fun2() {
top.window.location = "https://google.com";
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 11:57 AM
If you want the message to stay on screen even after redirecting the user to list view and user needs to remove the message manually, use After Insert BR and in the Actions tab enter your message.
If you want the message to disappear before redirecting to list view, use OnSubmit client script and use g_form.addInfoMessage("Incident submitted successfully.")
Mark it correct if it resolves your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 12:05 PM
HI Ben,
Do it using an after insert BR. Try using business Rules and Workflow as much as possible. Avoid using client scripts, except for Catalog Client Scripts (which are unavoidable). This is due to performance reasons and browser issues that client scripts can introduce.
AFTER business rule(with update checkbox set to true) and under action tab set "Add Message" field to true, Set the message in the message box field.
Thanks
Rahul Kathuria