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 01:48 AM
yes, I want to show alert messages if the field is not populated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 01:50 AM
Hi Shivani,
Are you doing this onSubmit?
Why not set those mandatory if they are always required to be populated on the form?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 02:28 AM
actually i can't keep owner field mandatory coz in another case i need to keep it blank and put value into another field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 02:32 AM
Hi Shivani,
Then you can do this using onSubmit client script and stop form submission if fields not populated.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2018 01:14 AM
When do you want to display that error message on the form ??