I have a SOSL query where I search for an email address in both Contact and Lead SObject. I instruct the query to return some fields like FirstName, MobilePhone, etc., Now, if my SF org does not have the MobilePhone field visibility to true, the query returns "Invalid Column MobilePhone".
Is there a way where I can fetch the available fields for a given object using the Force.com REST API before firing my query?
My SOSL query is
FIND {[email protected]} IN EMAIL FIELDS RETURNING Contact(Phone, Id, Department, Email, isDeleted, Name, MailingCity, Title ), Lead(Id, City, Company, Country, Name, MobilePhone, Phone, State, Status, Street, Title)