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
kamal3883kamal3883 

Value does not exist or does not match filter criteria + Java script button

Hi, 

I try to autofill a lookup field on Case on click of Java script button. This lookup field is dependent on Account lookup on case. Account field is populated absoultey fine. But i am getting this error "Value does not exist or does not match filter criteria".  Value is also correct. Even i was not facing any issue on save of record. only problem is its showing error on edit page which is very weird.Here is part  of code:

&CF00Nm0000000JZ5l={!URLENCODE(Asset__c.Name)}&CF00Nm0000000JZ5l__lkid = {!Asset__c.Id } "
Anil KamisettyAnil Kamisetty
Hi Kamal

Salesforce allows you to create Lookup Fields. And while creating lookup fields, you can specify filter conditions. For example, Contact can be associated to an Account of Type INTERNAL (Internal and External are two Account Types). Thus, when the lookup field is accessed, it shows only Internal Accounts.

Lookup field can be created any time, need not be when the object is created. There are two probable reasons in your case.

1. Lookup field was added at a later time, not when the object was created. Before the lookup field was added, there are some records who does not meet the criteria and you are getting this error now
2. Some one did enter the data on the backend with out enforcing this condition

Here is what you should do.

1. Disable the filter condition on the Lookup field and try the operation. Thus you can ensure the reason for the error
2. Once the reason is Identified, fix the lookup value for the record (not just this record, all records on this object which might have the same error)

Note : If this answers your question, please mark this as Answered, thus helping others.
kamal3883kamal3883
Thanks Anil for Reply. But my problem is little bit different. i am facing this issue while clicking on java script button to auto populate vaule in this lookup field.

data is new. One more thing is when i am using URL hacking to autofill there is no issue. But there are many validation because of that i need to use java script button.