You need to sign in to do that
Don't have an account?
Dheeraj shokeen
"AuraEnabled methods do not support return type of List<Schema.FieldSetMember> How to Fix it inside the LWC
Below the Code
public class DynamicRecordEditFormController {
@AuraEnabled(cacheable=true)
public static List<Schema.FieldSetMember> getFields(String fieldSetName, String objectName) {
Schema.SObjectType sObjectType = Schema.getGlobalDescribe().get(objectName);
Schema.FieldSet fieldSet = sObjectType.getDescribe().fieldsets.getMap().get(fieldSetName);
return fieldSet.getFields();
}
}
public class DynamicRecordEditFormController {
@AuraEnabled(cacheable=true)
public static List<Schema.FieldSetMember> getFields(String fieldSetName, String objectName) {
Schema.SObjectType sObjectType = Schema.getGlobalDescribe().get(objectName);
Schema.FieldSet fieldSet = sObjectType.getDescribe().fieldsets.getMap().get(fieldSetName);
return fieldSet.getFields();
}
}
I think this can help you: https://techdicer.com/field-set-in-apex-lwc-salesforce/ (https://techdicer.com/field-set-in-apex-lwc-salesforce/" target="_blank)
Otherwise, you can use a Wrapper Class too.