function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jishan royjishan roy 

Method does not exist or incorrect signature: void deserialize(Object) from the type System.JSON

I am facing this problem  Method does not exist or incorrect signature: void deserialize(Object) from the type System.JSON
This is my apex class:

public with sharing class contactController {
@AuraEnabled
    public static void saveContacts(List<Object> listContact)
    {
        list<contact> conlist = new list<contact>();
        //Insert listContact;
        for(Object a:listContact){
            (contact)JSON.deserialize(a);
            conlist.add((contact) JSON.deserialize(a));
           
        }
        update conlist;
    }
}

thanks in advance.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Jishan,

Can I know why you are trying to deserialize the List of contacts . Is this something you are getting from external system. The syntax for Deserialize is wrong . Please find the below artcile for list of all methods for Json Class.
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Json.htm#apex_System_Json_deserialize

If this solution helps, Please mark it as best answer.

Thanks,
 
jishan royjishan roy
hii Sai praveen,
i want to tell you i have to display the contact record in account page and the phone field of the column is editable thats why i write this apex class for desearialize.I want to update this phone field