- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 11:46 PM
Dear experts,
I am facing a problem where currently if I did not tick the value_certified box for metric data task, it will abort the action but it wont force a refresh rule to refresh the page, so user have to refresh the page manually to go back to the previous state, but in the loading page it shows that the task has moved forward to awaiting approval state. So if I want to make the page refresh or force reload the page after it has check and the message also appear after it refresh and remain back in the in progress state. How can i do so?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 10:40 PM
Instead of modifying the Business Rule, I added a query in the UI Action for Request Approval button, where I defined as follow:
if (!current.value_certified) {
gs.addErrorMessage("Please select the check box to certify and acknowledge that the information provided by you is accurate.");
action.setAbortAction(true); // Stop the action from continuing
} else {
current.setValue('state', 3);
current.update();
action.setRedirectURL(current); // Redirect to the same form
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 06:55 PM
Hi @ChuanYanF ,
you can create onSubmit client script for this
keep the BR as is
create a onSubmit Client Script which does the same validation
and if you condition is not satisfied as mentioned in the message(certify checkbox is not checked)
return false in the script
use method location.reload() to reload the form
it might alert something like this
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 10:27 PM
Hi Chaitanya, I tried using OnSubmit script but it does not work, but I am trying the onChange client script, but it also does not work, can you help me check my script??
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue !== '3') {
return;
}
var checkboxValue = g_form.getValue('value_certified');
if (checkboxValue !== 'true') {
g_form.showFieldMsg('value_certified', 'Please check the box to certify before submitting for approval.', 'error');
alert('Please select the check box to certify and acknowledge that the information provided by you is accurate.');
// Revert the state change
g_form.setValue('state', oldValue);
// Optional: force refresh if needed (use only if state gets stuck visually)
// setTimeout(() => location.reload(), 100);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 10:40 PM
Instead of modifying the Business Rule, I added a query in the UI Action for Request Approval button, where I defined as follow:
if (!current.value_certified) {
gs.addErrorMessage("Please select the check box to certify and acknowledge that the information provided by you is accurate.");
action.setAbortAction(true); // Stop the action from continuing
} else {
current.setValue('state', 3);
current.update();
action.setRedirectURL(current); // Redirect to the same form
}