how to make a field mandatory before it goes for approval using business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 09:37 AM
trying to make field mandatory before user submits it before approval.
do not want to use client script or on dictionary level.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 09:58 AM
Hi,
Using a Business rule can be done, but without a Client script or an UI policy the user will not have any indication that that field is mandatory.
So it might not be the best user experience, to have an error message stating invalid insert, without first showing which field should be filled in.
To make a field mandatory with a business rule you can write something like below example.
(and this simple example doesn't even need to use script, it could be done with conditions filter and actions alone.
Business rule runs before insert
(function executeRule(current, previous /*null when async*/) {
if (!current.getValue('description')) {
gs.addErrorMessage('Description is mandatory, cannot be empty');
current.setAbortAction(true);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 02:18 AM
hi Olan,
how can I add this condition in if --> my field1 contains some value and field2 is checked then only proceed or else stop the action with some message.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 02:09 AM
Hi, sorry for the late response.
Can you please elaborate what you mean?
If I understand you correct, you can with a Regex perform validation that the text entered matches some given pattern.