You need to sign in to do that
Don't have an account?
Parteek Goyal 3
Address fields can only be filtered using Distance expressions
Hi All,
I want to search Contacts using this query.
List<Contact> listcontact=[SELECT id,name,phone from Contact where Lastname=:lname and MailingAddress=:mailingaddress];
But unexpectedly it give the error.
Address fields can only be filtered using Distance expressions
Please help me..
I want to search Contacts using this query.
List<Contact> listcontact=[SELECT id,name,phone from Contact where Lastname=:lname and MailingAddress=:mailingaddress];
But unexpectedly it give the error.
Address fields can only be filtered using Distance expressions
Please help me..
Instead of compound field try to use individual fields MailingAddress.City, MailingAddress.Street etc. It should work.
Hope this helps!
Regards,
Vivek Patel.
All Answers
Instead of compound field try to use individual fields MailingAddress.City, MailingAddress.Street etc. It should work.
Hope this helps!
Regards,
Vivek Patel.
Hi Parteek Goyal,
By task description: The method searches for contacts that have a last name matching the first string and a mailing postal code (API name: MailingPostalCode) matching the second. It gets the ID and Name of those contacts and returns them. You should change from MailingAddress to MailingPostalCode.
Best regards,
Dinmukhamed Junussov