I have a form that uses a Lookup field to insert Company Name from another form. It uses a Watch filter to only pull the companies assigned to the specific employee using the form. I would like to ignore this rule for the Admin so the Admin can submit for any and all companies. Is there some PHP code that could help with this? Thanks for your help, Chris
Thanks Bobby. I had actually tried this, but it didn't work for me. I'm not using a current_user filter. I'll paste an image below of the filter I'm trying to ignore.
Can’t you just delete that watch then?
Unfortunately, I cannot b/c this form is being used by both the Admin and the Account Executives. The AEs are only able to see the clients assigned to them, whereas the admin should be able to see all clients when adding entries in this specific form.
function change_lookup_options( $options, $args ) { $user = wp_get_current_user(); // Check if the user is an administrator if ( in_array( 'administrator', $user->roles ) ) { // Check if the Lookup filters are being applied to the specified field if ( $args['field']->id == <FIELD_ID> ) { // Remove the Lookup filters $options = array(); } } return $options; } add_filter( 'frm_filtered_lookup_options', 'change_lookup_options', 10, 2 );
I tested this now, and it doesn't appear to be working, sorry I will keep trying at it when I have time.
Please login or Register to submit your answer