Activity Forums Salesforce® Discussions What is a difference between the capabilities of @RemoteAction methods and JSON.deserialize in salesforce?

  • What is a difference between the capabilities of @RemoteAction methods and JSON.deserialize in salesforce?

    Posted by Mohit on October 12, 2016 at 2:13 pm

    Hi All,

    What is a difference between the capabilities of @RemoteAction methods and JSON.deserialize in salesforce?

    Please give suggestion

    PRANAV replied 8 years ago 2 Members · 1 Reply
  • 1 Reply
  • PRANAV

    Member
    October 13, 2016 at 5:40 am

    Hi Mohit,

    There are many differences between these two as

    • DateTimes de/serialize as quoted strings and for a time, the @RemoteAction serializer did not.
    • @RemoteAction methods can serialize, but not deserialize ENUM values.
    • JSON.deserialize will not handle deserializing into List<Object>, @RemoteAction deserialization will deserialize primitives properly into List<Object> but complex types will deserialize as nulls.
    • Returning from a @RemoteAction doesn't run getters, JSON.serialize does.
    • JSON.deserialize and @RemoteAction deserialization both run setters.

    Hope this helps you.

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos