- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 12:15 PM
Hello All
I want make work notes field mandatory in list view when state is pending , close complete etc... could somebody advise me how can I achieve this without using data policy.
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 12:42 PM
Sure. Create a BEFORE Business rule with filter condition as state | Changes to | Pending,close compelte with script as
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.work_notes.getDisplayValue() == null) {
//do something
current.setAbortAction(true);
gs.addInfoMessage('PASS YOUR CUSTOM MESSAGE HERE');
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 12:17 PM
You can use business rule to check if worknotes is empty when state is Pending etc and use SetAbortAction function to abort the save action if work notes is empty.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 12:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 12:31 PM
Could you please share code with me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 12:42 PM
Sure. Create a BEFORE Business rule with filter condition as state | Changes to | Pending,close compelte with script as
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.work_notes.getDisplayValue() == null) {
//do something
current.setAbortAction(true);
gs.addInfoMessage('PASS YOUR CUSTOM MESSAGE HERE');
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 12:45 PM
i think it should be work_notes