Created
May 1, 2016 16:23
-
-
Save atulgupta31/fba3203d4d41370c8d6f2143f60c909f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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