Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atulgupta31/fba3203d4d41370c8d6f2143f60c909f to your computer and use it in GitHub Desktop.
Save atulgupta31/fba3203d4d41370c8d6f2143f60c909f to your computer and use it in GitHub Desktop.
/**
* @Description: This method returns a list of FieldSetMember as per the Object and Field Set Name
* @Arguments: NA
* @Return: List<Schema.FieldSetMember>
**/
private List<Schema.FieldSetMember> getFields() {
/** @Description: Account is the object and FieldSetName is the API Name of the FieldSet **/
return SObjectType.Account.FieldSets.FieldSetName.getFields();
}
/**
* @Description: This method returns the query string
* @Arguments: NA
* @Return: String
**/
private String getQuery() {
String query = 'SELECT ';
for(Schema.FieldSetMember f : getFields()) {
query += f.getFieldPath() + ', ';
}
query += 'Id FROM Account LIMIT 2000';
return query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment