- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2015 11:58 AM
Hi All,
I am trying to trigger an event within a Business rule. For that, I am using the Advanced section of the business rule where I have my conditions in the condition field as 'current.substatus.changes() && current.substatus == "pending_disposal"' and then I have a function within the script block:
sendEmailOnChnageOfSubstate();
function sendEmailOnChnageOfSubstate(){
gs.eventQueue ("name_of_event", current, null, null);
}
And then I have a notification which fires my event and that notification has a email hard-coded within the body.
The above code is not running.
Can anyone help me modify it so that it runs fine. Appreciate your help.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2015 12:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2015 12:03 PM
You could do current.substatus.changesTo("pending_disposal")
Check to make sure substatus is the actual name of the field. What is the table?
Your event is registered, right?
Other than that, it looks good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2015 12:20 PM
Hi Mike,
Yes substatus is the correct field name on alm_asset table.
Yes I have my event registered.
I will try you code and see if it works.
I am not sure if I need to call my function in the condition field?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2015 12:27 PM
No, it would be in the script field:
sendEmailOnChnageOfSubstate();
function sendEmailOnChnageOfSubstate(){
gs.eventQueue ("name_of_event", current, null, null);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2015 12:32 PM
I have the exact same thing its still not working