Event gets triggered multiple times when selecting multiple records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 12:03 AM
I have a button on the related list of one of my custom tables in workspace that I created using Action Assignment. In this related list, multiple records can be added. The records can be selected using the checkbox. I'm trying to trigger one single notification when any number of records are selected in this related list and the button is clicked. However, I'm unable to do so as multiple events are getting triggered when I select multiple records resulting in multiple emails getting triggered. This issue does not occur in native view as I've used GlideRecord in my UI action to fetch all the records and used the gs.eventQueue method outside the while loop.So, no matter how many records I select, event gets triggered only once in native. But since GlideRecord does not work on Action assignment, I wrote a Business rule to achieve the same but it's not working as I intend.
UI Action code(Button in native that's working):-
Business rule code(To fire event from workspace):-
Action Assignment Code:-
if(current.u_state == '2'){
current.u_state = '3';
current.u_unique_id = newAthleteId;
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 02:02 AM
Hi Lokesh,
Populate one of the event parms with the parent sys_id and add to the script another GlideRecord that runs on the sysevent table and search for the same event name and the same parent sys_id and only if not found create the event.
Mark as correct if you find this answer helpful.
Thanks.