function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sekhar SekharSekhar Sekhar 

How to set Look up filter with Record Type

Hi
In my Account object has 2 record types 1) Customer 2) Vendor
Created one custom object(Trade Reference) with Account lookup and contact lookup and designed a custom form (vf page ) with Trade Reference fields
In that form When click on account look up field it display only Vender record type Records only it is done successfully
After when click on contact lookup it display only above selected account record related contacts only (i.e contacts should be under selected account related only ) it is done
Now my Requirement is
In account à Customer record type Record (not a vendor record) àdetail page has button (Application)
When click on Application button Form will be open (vf page) in that vf page account look up is displaying vendor records and contact also showing related account records
But when click on save button it display error message
  • Contact: Value does not exist or does not match filter criteria.
  • System.DmlException: Insert failed. First exception on row 0; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [Contact__c]
Account lookup field (Company Name) filter condition
Filter Criteria         Company Name: Account Record Type: Name EQUALS Accounts - Vendor
Filter Type             Required. The user-entered value must match filter criteria.
Active                    True

Contact lookup field (Contact) filter condition
Filter Criteria          Trade References: Company Name ID EQUALS Contact: Account Name ID
Filter Type              Required. The user-entered value must match filter criteria.
Active                    True
 
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Sekhar, hope it helps.

Please mark it as best answer if the information is informative.

Thanks
Rahul Kumar

 
Sekhar SekharSekhar Sekhar
Hi Rahul

Thanks for u r replay 
But i did not get any soluctions 

Any one have an answer for this Requirement Please Help me

Thanks in advance.
 
RF Admin 7RF Admin 7
How did you achieve the first half part of the functionality, i am stuck in first one, and really need answer on urgent basis
Piyush Pardikar 4Piyush Pardikar 4

Hi @RF Admin, @Shekhar,

I have implemented this lookup filter in my personal org and I am able to achieve the above functionality which Shekhar has mentioned in 1st part of his question. PFB snap for same.

This filter has been applied considering scenario what Shekar has asked.

Account lookup field (Company Name) filter condition
Filter Criteria         Company Name: Account Record Type: Name EQUALS Accounts - Vendor ( this will come on screen to select like in my case It can be Bill To, Ship To etc..[search icon])
Filter Type             Required. The user-entered value must match filter criteria. ( this can be value user can enter what he is expected like what I have shown Corporate Customer or Pharm/Bio, etc..) but make sure values should match with Record Types name
Lookup filter for a lookup field
Please mark this as best answer. If this resolved your query.

Thanks & Regards,

Piyush