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
Priya GuleriaPriya Guleria 

Sobject related Error

Error: Compile Error: Invalid constructor syntax, name=value pairs can only be used for SObjects in line Contact con =new Contact ( ... please 
 Lead ld=new Lead(
        FirstName='Cal',
        LastName='Smith',
        Company='IBM'
      );
    Contact con = new Contact(
        FirstName='Paul',
        LastName='Smith'
    
   );
Dilip_VDilip_V
Priya,

Make sure that you don't have class with name contact in your org.

Thanks.