- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 10:28 AM
I have come to a road block here.I have a onAfter business rule which entirely depends on current.operation() and it is null. The business rule is firing.The first gs.info message logs:Business rule running: null 4f65a2676f9a0200b5919e0cbb3ee43b. Does not go beyond that.I am also attaching the image of business rule.Any direction will be helpful.I am on Fuji Patch 7.
function onAfter(current, previous) {
//This function will be automatically called when this rule is processed.
gs.info("Business rule running: {0} {1}", current.operation(),current.sys_id);
if( current.operation() == "insert" ) {
gs.log('Insert rule running:', 'Location Sync Remote App Table');
insertToRemoteTable(current);
}
else if( current.operation() == "update") {
gs.log('Update rule running:', 'Location Sync Remote App Table');
updateOnRemoteTable(current);
}else if ( current.operation() == "delete") {
gs.log('Delete rule running:' , 'Location Sync Remote App Table');
deleteFromRemoteTable(current);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 12:16 PM
I don't believe that operation is available for an 'after' business rule.
I would suggest creating two separate business rules, with the insert and update only checked respectively.
(Other option is make it a before, but it could be a performance hit.)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 10:36 AM
I may be wrong here but is there any function as gs.info ?
Shouldn't it be gs.addInfoMessage ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 10:40 AM
Hi Kalai,
Yes there is a function gs.info. Please check section 4.3 for more info.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 10:42 AM
Never used that one before I just saw the page after replying

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 10:48 AM
Hi Tessy,
If you are creating this BR as part of scoped application then remove the statement gs.log as this is not supported as part of scoped application. Try gs.info or gs.debug for scoped application.
Please let me know if you have any questions.