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 9 years, 11 months 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

Pros & Cons of Lightning Component vs. 3rd party frameworks in Salesforce UI development

Video in

Nikita drops by to share his invaluable experience of using popular 3rd party frameworks in Salesforce. http://media.blubrry.com/salesforceway/audio.xmcdn.com/group42/M05/25/57/wKgJ81rXk6XjaZIAAU_I_KtprFM998.m4a