Refresh the Incident form upon clicking the "Post" button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 01:34 AM
Hi,
How do I make the incident form refresh after clicking the "Post" button under the Notes tab? There is an info message that should show up if the assigned_to is empty and the "Post" button is clicked, but it only shows up when the form reloads.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 01:54 AM
The 'post' button is meant to post work notes without saving the form, so that won't work. You could try a client script on change of the work notes field, because it is saved in the background. Not sure if that will work (my PDI is asleep, so can't test it now).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 03:49 AM
Hi @Mark Manders ,
I found the Business Rule for the info message. I find it odd that I still need to refresh the page, fully, for the info message to appear even though the BR was set to before update. I tried to add gs.setRedirect(true) in the script but it still won't work. Here is the script below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 01:08 AM
A before BR runs before the record is updated to the server. The post button doesn't update the record itself, it just writes the comment/work note to the sys_journal_table.
You need to save the ticket to start the process of writing to the server and then the message shows. But why make it so hard? The ticket should have an assigned_to before it's saved to the server. Just make the field mandatory.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 01:58 AM
Hin @paulmagaling ,
Option 1: Use a Client Script (UI Type: All)
You can use a Client Script to detect when the "Post" button is clicked and then trigger a form refresh (g_form.reload()).
🔧 Client Script Example:
// Type: onLoad
function onLoad() {
// Wait for DOM to load
setTimeout(function () {
// Look for the "Post" button in the Notes tab
let postButton = document.querySelector("button[aria-label='Post']");
if (postButton) {
postButton.addEventListener('click', function () {
setTimeout(function () {
g_form.reload(); // Refresh the form after posting comment
}, 500); // Slight delay to allow comment processing
});
}
}, 1500); // Allow time for the Notes tab to render
}
If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Pratik