print values on form using business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 12:06 AM
I have written a business rules on a custom task table, which should print error messages on form if any of the mentioned field value is not given.
for example, i have a field 'owner ' on which i have written a business rule which should mark state to closed complete if value in owner field changes. Along with this implementation I want an error message to be displayed on form below owner field that 'error assign owner'.
I have tried implementing:
gs.addErrorMessage('Form Error Message Text');
gs.addErrorMessage(gs.getMessage("Choose approval or rejection"));
gs.addErrorMessage('Choose approval or rejection');
g_form.addErrorMessage('This is an error');
current.approval.setError('Choose approval or rejection');
current.approval.setDisplayValue('Choose approval or rejection');
current.approval.setValue('Choose approval or rejection');
can someone help me to print values on form using business rule?
thank you,
Shivani.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 12:10 AM
Hi Shivani,
Can you please elaborate your requirement?
Regards,
Afifa

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 12:16 AM
g_form won't work in business rule.
If you want to add error message then you can try gs.addErrorMessage("Give required message here");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 12:23 AM
i want to display a message on form .. gs.addE.. does't print message inside form. I tried implementing it but still message is not displaying inside of form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 12:41 AM
Hi Shivani,
So if field is not populated you want to show the message? Do you want to show an alert or show field message besides the field.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader