How to search Active and Inactive users in Sidecar module filters?

Hello,

In sidecar modules, the 'Assigned to' filter returns only Active users?

Is there a way to search Inactive users as well?

I have SugarCRM 8.2 Pro.

I followed the below post and was able to search inactive users in bwc modules but not in sidecar.

How can you populate active and inactive users in Assigned To field? 

Please help.

Thanks,
Shantanu

  • Hi Shantanu,

    You can extend the PersonFilterAPI (clients/base/api/PersonFilterApi.php) in order to do this and check the method getCustomWhereForModule. That method can be extended or you can create your own to add the 'Inactive' status on the below line:


    if ($module == 'Employees') {
    $query->where()->equals('employee_status', 'Active')->equals('show_on_employees','1');
    return;
    }

    // TODO: Add Inactive status here
    $query->where()->equals('status', 'Active')->equals('portal_only', '0');
    return;
    }

    Note that after changing this, anyone can now filter or assign records to Inactive users.

    Regards,

    Kaizer

  • Thanks a lot Kaizer. This worked for me.

    Regards,

    Shantanu Agnihotri