You need to sign in to do that
Don't have an account?
John Smith
Help on SOSL Query, incorporating Where conditions.
I'm trying to build a SOSL query, but unable to figure out to incoporate "Where"Statement in the SOSL.
My SOSL is as follows:
string query = 'Find \'' + ContactSearch +'\' RETURNING contact(AccountId,Account.AccountNumber,Account.Name,' ;
query+= 'Id, Name, Phone, Email, CS_Support_Contact__c, RecordTypeId)';
I need to add the Where conditions,
Account.Status__c ="Active' and Inactive_Contact__c = false.
Please advise me in this issue.
String ClientAccountId = ClientAccountRt.Id;
Try this
All Answers
Try this.
I thik you still need to have IN condition in the Query. might be something like this
Thats worked, Thanks. I was trying to add two more conditions:
AccountId != null and Account.RecordTypeId = :clientAccountRT.Id
Its throwing up error, I think i missed some syntax. Can you please guide me.
String ClientAccountId = ClientAccountRt.Id;
Try this
Thanks Naidu, It worked really well.
Can we search multiple fields like Name and Phone Numbers
for example " IN Name Or Phone Fields"
I am afraid we cannot.
Please check this link for reference:
http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_calls_sosl_find.htm|StartTopic=Content%2Fsforce_api_calls_sosl_find.htm|SkinName=webhelp