If I use a Before Query business rule will it cause performance issue

Akshay Pundeer
Tera Contributor

If I use a Before Query Business Rule and my system has 230,890 records in the HR case table, will it cause an issue?

I'm not using ACLs because there are too many on the HR table and its parent table, making it time-consuming and leading to conflicts.

 

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

    var globalMobilityGroup = '0cd7b8d31b3204144b9e433fbd4bcb21';
    var allowedServices = [
        'd31f18171b3ec0144b9e433fbd4bcb71',
        '2723c6ae1bb594104b9e433fbd4bcbd3',
        '65347bc91b23f700f96c0dc2cd4bcb6b'
    ];

    if (!gs.getUser().isMemberOf(globalMobilityGroup)) {
        current.addQuery('hr_service', 'NOT IN', allowedServices.join(','));
    } else {
        var query = current.addQuery('assignment_group', globalMobilityGroup);
        query.addOrCondition('hr_service', allowedServices[0]);
        query.addOrCondition('hr_service', allowedServices[1]);
        query.addOrCondition('hr_service', allowedServices[2]);
    }

})(current, previous);
7 REPLIES 7

sunil maddheshi
Tera Guru

@Akshay Pundeer 

I think you should use HR COE Security Policies instead of a Before Query Business Rule.

  • It improves performance and reduces complexity.
  • It is maintainable and built for HR data security.

Please mark correct/helpful if this helps you!

Akshay Pundeer
Tera Contributor

So if i'll use COE security policy will ACL's not override it?

Sandeep Rajput
Tera Patron
Tera Patron

@Akshay Pundeer As suggested by others, you should not use before query business rule in this case and opt for COE ACLs instead. Before query business rules with such case volume will certainly slow your instance down.