G_modal always disappears after clicking Save/Submit and brokes Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 01:11 AM
Hello All!
I hope you can help me again with some issue regarding working with g_modal pop up.
Our customer uses Agent Workspace to perform daily duties. We implemented a new button that opens a new Fallout in the pop-up window, and creating Fallout this way worked great until I had to enter the Business Rule which made Assigned To required for Fallout creation. If Assigned To is empty, Fallout creation should be blocked, a message should be displayed and a pop up should stay opened to allow for changes. The resulting problems are listed below along with the code fragments.
We are using g_modal.showFrame() to open pop up and display all data within. When we try to trigger business rule by creating Fallout with no Assigned To we can't get it working correctly.
Business Rule is working, it's preventing Fallout from being created but in the same time it's always closing pop up and reloading the page.
I'm looking for a solution how to leave the pop up open.
My Client Workspace Script works like that. It makes a Ajax request which returns all neccesary data and then populates them to g_modal. I will attach here only the last part of code as we don't have any troubles with previous parts.
function openPopup(paramsObj) {
g_modal.showFrame({
url: paramsObj.url,
title: paramsObj.title,
size: paramsObj.size,
height: paramsObj.height,
});
}
I had in above code callback function but get rid of it currently as a desperate attempt to stop pop up from closing
callback: function() {
location.reload();
}
Our Business Rule is using no code low code approach and it is working absolutely fine on backend.
In pop up it displays our error message informing that Assigned To can't be empty but this message is visible for something about 0.5 second before the pop up is disappearing.
I already found and read this neat guide from Ashley but didn't found anything that would be helpful for me.
And lack of other documentation for g_modal is making this thing real issue for me.
Anyone knows how to implement correct behaviour? How to make pop up open when BR is triggered?
- Labels:
-
Scripting and Coding