You need to sign in to do that
Don't have an account?
jishan 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.
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.
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,
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.