I am trying to learn FieldSet from this Salesforce document but i am getting the following Error while saving this class
public class MerchandiseDetails {
public Merchandise__c merch { get; set; }
public MerchandiseDetails() {
this.merch = getMerchandise();
}
public List<Schema.FieldSetMember> getFields() {
return SObjectType.Merchandise__c.FieldSets.Dimensions.getFields();
}
private Merchandise__c getMerchandise() {
String query = 'SELECT ';
for(Schema.FieldSetMember f : this.getFields()) {
query += f.getFieldPath() + ', ';
}
query += 'Id, Name FROM Merchandise__c LIMIT 1';
return Database.query(query);
}}
Error: MerchandiseDetails Compile Error: dimensions is not a fieldSet of Merchandise__c at line 10 column 16
should i need do extra settings to enable FieldSet?
Thanks