Activity Forums Salesforce® Discussions Why do we deserialize our Salesforce JSON response in different Formats?

  • Why do we deserialize our Salesforce JSON response in different Formats?

  • Aman

    Member
    July 10, 2017 at 2:34 pm

    Sometimes we deserialize our response in Apex class, sometimes in Map and sometimes in simple sObjects.

  • Manpreet

    Member
    January 30, 2018 at 4:08 pm

    Hi Aman,

    This totally depends upon our requirement. If we need 2 or 3 fields from the Response then we don't need to create an additional class. If our response size is large then probably we can make use of an apex class. Thus it all depends upon requirement.

    Thanks.

  • Avnish Yadav

    Member
    September 30, 2018 at 3:13 am

    If you didn't serialize the object into JSON, then the object would not be in a format that the consumer (the system who did the request) would understand. The purpose of serializing it into JSON is so that the message will be a format that can be understood and from there, deserialize it into an object type that makes sense for the consumer.

Viewing 1 - 3 of 3 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Salesforce Interview Questions and Answers - For Freshers and Experienced Candidates

Video in

Learn most important Salesforce Interview Questions and Answers, asked at every interview. These Interview questions will be useful to all entry-level candidates, beginners, interns, and…