You need to sign in to do that
Don't have an account?
SazEast
help with mapping JSON2Apex Class to Salesforce Object Fields
Hello, I'm a complete newbie to API integration - I have REST web service exposed to consume third party data which is to update records in Salesforce. I've got the JSON2Apex Class as the JSON is nested but unsure how to use this to map JSON fields/objects to Salesforce field names. I'm struggling to find any guidance online, please could someone point me in the right direction?
Hope below links gives you more information on JSON deserialization.
https://salesforce.stackexchange.com/questions/158493/field-mapping-from-json-response-to-custom-object
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Json.htm#apex_System_Json_deserializeUntyped
https://www.biswajeetsamal.com/blog/dynamic-data-creation-in-salesforce-from-json-data-without-using-wrapper-class/
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_json_jsonparser.htm
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
Can anyone please help me fix the below code?
exmaple JSON:
Wrapper Class:
Rest upsert class: