You need to sign in to do that
Don't have an account?
Meena25
System.JSONException
System.JSONException: Apex Type unsupported in JSON: Schema.SObjectType (through reference chain: common.api.soap.wsdl.FieldSet["sobjectType"])
Schema.FieldSet fs1 = Schema.SObjectType.Lead.fieldSets.getMap().get('CreateLeadElmoService');
system.debug('fs1 -->' + fs1);
string body = JSON.serialize(fs1);
I am unable to serialize my fieldset. please suggest solutions.
Schema.FieldSet fs1 = Schema.SObjectType.Lead.fieldSets.getMap().get('CreateLeadElmoService');
system.debug('fs1 -->' + fs1);
string body = JSON.serialize(fs1);
I am unable to serialize my fieldset. please suggest solutions.
If you just want the Fields from FieldSet then you can use the below code:
Schema.FieldSet fs1 = Schema.SObjectType.Lead.fieldSets.getMap().get('CreateLeadElmoService');
system.debug('fs1 -->' + fs1);
List<String> fieldschema = new List<String>();
for(Schema.FieldSetMember sfield : fs1.getFields() ) {
fieldschema.add(''+sfield);
}
string body = JSON.serialize(fieldschema);
system.debug(' ==> ' + body);
Thanks,
Maharajan.C
system.debug('fs1 -->' + fs1); is getting truncated and am unable to see lead id etc.. how can i limit this fieldset to 1 like in a query?
i gett status code 411 --> length required as of now.