Triggering event from Business rule

munwala
Kilo Contributor

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,

1 ACCEPTED SOLUTION

I created this:


Capture.PNG


Capture2.PNG



and got this:


Capture3.PNG



Is this how you are set up?


View solution in original post

12 REPLIES 12

I created this:


Capture.PNG


Capture2.PNG



and got this:


Capture3.PNG



Is this how you are set up?


Yes this is the way I am setup and I do see the event in my Event log. But the notification is not being sent.


Hello Mohammed,



If the notification is bot being sent is probably because there is not a recipient for the notification. Try specifying a recipient in the email notification


Ok, well, that is a different thing.   There are multiple things in play.   The notification has to be set to send when an event is fired.   My guess is that you need to have 'Send to event creator' checked to see the notification.   Notifications won't fire if you are the event creator.   They also have to have the user have notifications enabled on the user record, as I assume you are doing this in a development environment.


Allen I have the notification pointing to the correct event. I also have the Send to event creator checked and I am checking the email in the system itself as it is the Dev environment where I am working.


I am using the same group for my another notification and its working fine. Its just this notification where its not working.



I also forgot to mention that I could trigger the event and notification only once. I have ran so many tests after but with no luck.