Business rules are getting called even after using gr.setworkflow(false)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2025 02:12 PM
Every assignment has a sub-group and which has members as manager, lead and a default approver in case the others are not available. Now when the group member is empty, I need to add them as members. When the length of array is 2, it works fine but as it becomes 3, it goes into an infinite loop and adds the lead 'n' number of times in sub-group.
It calls another business rule written on Group member table.
var grp = current.assignment_group.sub_group;
if (grp) { // update members
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2025 05:28 PM - edited ‎05-31-2025 05:28 PM
Its case sensitive.
grpMember.setWorkflow(false)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2025 11:11 AM
Still doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2025 11:47 AM
Then you have some other problem, like 'sub_group' not being defined on any table. Anyway, see definition of .setWorkflow() here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2025 12:41 PM - edited ‎06-01-2025 12:42 PM
Please be specific about HOW it doesn't work. What happens?
Have you logged out your variables so you're CERTAIN they are the values you expect when the rule triggers? As @Bert_c1 suggests... that setWorkflow(false) is inside the if, so if that first if doesn't evaluate, you won't trigger the setWorkflow(false) and thus other business rules can trigger.