You need to sign in to do that
Don't have an account?
Dhivya K
SOSL search by id
Hi,
I wanted to retreive contact object that is mapped to a specific account. Is this possible with SOSL? I am getting null contacts for the given accountid. If this is not possible, kindly suggest me an alternate that could fetch all contacts mapped to a account,website id,etc.
This is my query:
String soslQuery = "FIND {" + accountid + "} IN ALL FIELDS " +
"RETURNING " +
"Contact(Id, Phone, Email, FirstName, LastName, AccountId,CEB_Id__c LIMIT 1), " +
"Account(Id, Phone, Name)";
Thanks
I wanted to retreive contact object that is mapped to a specific account. Is this possible with SOSL? I am getting null contacts for the given accountid. If this is not possible, kindly suggest me an alternate that could fetch all contacts mapped to a account,website id,etc.
This is my query:
String soslQuery = "FIND {" + accountid + "} IN ALL FIELDS " +
"RETURNING " +
"Contact(Id, Phone, Email, FirstName, LastName, AccountId,CEB_Id__c LIMIT 1), " +
"Account(Id, Phone, Name)";
Thanks
Select id, phone, email, firstname. lastname, accountid , CEB_ID__c, Account.phone, Account.name from Contact
You can search text, email, and phone fields for multiple objects, including custom objects in SOSL.We cant search using the id field it seems.To solve your issue you can create a text field with a name like "theAccountId" and populate the filed with value of the corresponding account ID.Then you will be able to use that in SOSL.Hope this will help you to solve your problem.