You need to sign in to do that
Don't have an account?

apex class contactsearch
Wondering if anyone would be able to assist. I am trying to perform a contactsearch that would return the name of a contact(or Salesforce ID) based on a couple cirteria. Any help is appreaciated.

Let us know if this will work
All Answers
1) Do you have Vendor__c field on contact object ?
2) Add return type to Method
3) Change method name.
Please update your code like below
public class contactsearch{
public Contact searchContact(String ContactType , String MemberState , String vendorId)
{
return [ Select Name From Contact
Where Contact_Type__c = 'Vendor Rep' AND States__c :MemberState AND Vendor__c :vendorId limit 1
];
}
}
Let us know if this will help you
I changed the code as suggested and received the following error for line 6:
unexpected token':'
I figured it might be that the '=' was missing just before :MemberState and also just before :vendorId. upon adding the "=' i recieved the original error message about no such column Vendor__c on Contact.
Let us know if this will work
Now I just need to find out how to incorperate it with my Visualforce page.
Thank you, Amit.