- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 12:33 AM
Can anyone help me as I need to display a alert message on incident form as mentioned in below screen shot.
When the field is empty and user tries to Update the from then alert message should display and should stop the form to update or save.
As tried with Business Rule and Client Script but didn't get the actual resul. @Ankur Bawiskar @AnveshKumar M @priyasunku @Vasantharajan N
Alert Message to display as below:
Written Business Rule:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 02:04 AM
Step 1: if you are running UI policy to make the field "Caused by" mandatory then do disable it and
Step 2: Use the onSubmit client script shared by other contributors in this forum or use the below onSubmit script.
try below code snippet
function onSubmit() {
if (g_form.getValue('u_caused_by_change') == 'true' && g_form.getValue('caused_by') == '') {
g_form.addErrorMessage("Please fill in the ‘Change’ detail in Related Records, as this incident is Caused by Change");
g_form.setMandatory('caused_by', true);
return false;
}
}
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 01:20 AM
it should stop submitting or update or save the form when the Caused by Change Field is empty.
Should show message as "Please fill in the ‘Change’ detail in Related Records, as this incident is Caused by Change" like below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 01:30 AM
Hi @Arjun Reddy Yer ,
It's Out of the box error message, It will be visible if we try to submit form without filling any mandatory fields. Since caused by change was mandatory and you are not filling the value you are getting this message.
I think OOB script overriding our client script due to that reason we are not getting our alert message.
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 01:02 AM
@Arjun Reddy Yer in business rule you are using alert can you replace it with gs.addErrorMessage
also remove add message as it you are adding message through script.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 12:52 AM
As when the User Checked the box the below field in Related List will be getting Mandatory.
But the User is asking to show the message as "Please fill in the ‘Change’ detail in Related Records, as this incident is Caused by Change" when tries to Update or Save the form even the field is empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 12:47 AM
@Arjun Reddy Yer please try using onsubmit client script on incident table
if(g_form.getValue('caller_id')==''||g_form.getValue('caller_id')==undefined)
{
alert('Message That needs to be displayed');
return false;
}
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful