Latest Updates
Travel to Technology
How to skip salesforce lookup filter?
How to Avoid Performing a Salesforce Lookup Filter Uses a Picklist?
There are many scenario user don’t want to fire lookup filter like while running some apex job or generating billing related record.
How to skip lookup filter?
1. Create a checkbox field on the User object.

2. Go to lookup filter and add below condition along with existing condition

3. While starting a batch job update current user with Skip lookup Filter flag to “TRUEâ€
list<User> lstUser = [Select ID, Skip_Lookup_Filter__c from User where ID =:UserInfo.getUserId()];
for(User iterator: lstUser) {
iterator.Skip_Lookup_Filter__c = True;
}
Update lstUser;4. On finish method update the user Skip Lookup Filter flag to “Falseâ€
list<User> lstUser = [Select ID, Skip_Lookup_Filter__c from User where ID =:UserInfo.getUserId()];
for(User iterator: lstUser) {
iterator.Skip_Lookup_Filter__c = false;
}
Update lstUser;Note: Keep in mind – While batch job is running at the same time user trying to create some record manually the lookup filter will not fire since skipped filter for that user.
Our Recent Blogs
-
27 Jan, 2021
Salesforce Architect Domain Exam
-
23 Nov, 2016
Salesforce Certified Technical Architect New Path
-
28 Mar, 2018
Salesforce Release Exam in Trailhead Certification
-
29 Dec, 2021
Salesforce Certifications