- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 05:03 AM - edited 01-16-2023 05:04 AM
Hello All,
I want to check current description is empty or not if its empty is want to abort action .
Thank You.
(function executeRule(current, previous /*null when async*/) {
current.addNullQuery(current.getValue('description'));
current.query();
if(current.next())
{
current.setAbortAction('true');
gs.addInfoMessage(current.number+" description Empty");
}
else{
gs.addInfoMessage("u can submit record");
}
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 06:29 AM
Hi @Sagar_pawar ,
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 06:43 AM - edited 01-16-2023 06:47 AM
Hi @Sagar_pawar ,
Create before business rule and insert/ update and try below code
(function executeRule(current, previous /*null when async*/ ) {
var inc = new GlideRecord('incident');
grinc.addNullQuery('description');
grinc.addQuery('number', current.number);//compare the current number
grinc.query();
if (grinc.next()) {
current.setAbortAction(true);
}
})(current, previous);
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 11:14 PM
Hi @Sagar_pawar ,
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 06:29 AM
Hi @Sagar_pawar ,
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar