
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2018 10:26 AM
I have an after business rule that runs on insert and update on the sys_user table. I create a new record in another table and need to check to see if the action on the sys_user table is an insert or an update.
How can I make that determination in the script section of a business rule.
For example: if the user record is being inserted, then I need to get the sys_created_on date for this record, If the user record is being updated I need to get the sys_updated_on date. Then I use this date for some comparisons.
Is there a way in the scripting section to make such a determination?
In the onBefore script for the LDAP User Import transform map there is a check using:
if (action == 'insert') ...
Does this work for business rules also?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2018 10:52 AM
try
if(current.operation() == 'insert')
More Info - https://docs.servicenow.com/bundle/kingston-application-development/page/script/business-rules/concept/c_DbActionsToTriggerTheBusRule.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2018 10:52 AM
try
if(current.operation() == 'insert')
More Info - https://docs.servicenow.com/bundle/kingston-application-development/page/script/business-rules/concept/c_DbActionsToTriggerTheBusRule.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2018 12:18 PM
Thanks Mike!
One of the challenges of the SN documentation is asking the right question. Thanks for the answer and the link!!
Rick Forristall

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 10:33 PM
Most of the methods on current object is available under GlideElement API in developer site.
There are a few surprises (like current.operation) under GlideRecord API.