Related List not triggering the business rule as expected.

pranavagarw
Tera Contributor

When I create or delete a record in the table Group Members(sys_user_grmember), i have a business rule that creates entries in Tenant User(u_tenant_user) table. It works fine.
The business rule is After: Insert, Delete

(function executeRule(current, previous /*null when async*/ ) {

    var tenantUtils = new testTenantUtil();
    if (current.operation() == 'insert'||current.operation() == 'update') {
        tenantUtils.createTenantUsers(current.user, current.group);
    } else {
        tenantUtils.removeTenantUsers(current.user, current.group);
    }

})(current, previous);

pranavagarw_0-1737967498437.png
It works fine this way.

But,
When I click on Edit/New button through related list, it does not create the records in Tenant User table. That means not triggering the business rule, which is given above.

pranavagarw_1-1737967672589.png

 

Thank You.

2 REPLIES 2

Mark Manders
Mega Patron

Since a couple of versions, there is a delay on adding users to groups (or removing them). They are queued. I don't know why they did this, but it could be related to your issue. 
 Try by setting de BR to async. Maybe that will do the trick.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Thank you for the reply.
But, it is not working. 😞