function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
logontokartiklogontokartik 

Search all fields in an Object using SOQL

Does anyone know how to search all fields in an Object for a given String using SOQL? I know we can do it in SOSL using IN ALL FIELDS, but since I am doing a search only on one object, was wondering if there is a way to do it via SOQL?

 

Appreciate your response.

 

Thanks.

Kartik

Ankit AroraAnkit Arora

Per my understanding only way to do this is describing all fields of the object, and creating dynamic query appending appropriate clause operator according to the type of field. Like if the field is a text field then operator in where clause will be "like" etc..

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

abivenkatabivenkat

 

hi,

 

i am having a douubt, in sql, it is possible to retrieve all the database name, its tables and its fields also. is this possible in SOQL in salesforce.com. please reply, thanks in advance..

 

thanks,

abivenkat,

SFDC Learner