give me examples of Before, After, Async and display business rules on incident table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2015 06:17 AM
Please explain with the examples of All types of business rules

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2015 06:28 AM
Hi Ganga,
These aren't exactly examples, but this is basically a simplified rule of thumb for business rules.
Value | Use Case |
---|---|
display | Use to provide client scripts access to server-side objects. For more information, see Scripting with Display Business Rules. |
before | Use to update information on the current object. For example, a business rule containing current.state=3; would set the State field on the current record to the state with a Value of 3. |
after | Use to update information on related objects that need to be displayed immediately, such as GlideRecord queries. |
async | Use to update information on related objects that do not need to be displayed immediately, such as calculating metrics and SLAs. |
Business Rules Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2018 03:17 AM
Hi Ganga,
i m trying explain after business here please take help to marketing event application in learning portal
if the requirement is like that in attendee table if record is inserted for any event then the count of attendee in marketing event table should be increases then we have to use after business rule on attendee table.hope it will help you
(function executeRule(current, previous /*null when async*/) {
gr=new GlideRecord('x_180940_marketing_marketing_event');
gr.get(current.marketing_event);
if(gr.number_of_attendees_registered==undefined)
{
gr.number_of_attendees_registered=1;
}
else
{
gr.number_of_attendees_registered +=1;
}
gr.update();
})(current, previous);