You need to sign in to do that
Don't have an account?
hector.asp2
Compile Error: Field is not writeable: Contact.Name at line
Hi All,
I got the following error
Compile Error: Field is not writeable: Contact.Name at line 66.....
Following is the code snippet
global class clsCustomWebService_MergeStdObject {
...................
...............
webService static String mergeContactStdObj (String MasterId, String Slave1Id, String Slave2Id)
{
..........//This statement works
List<Account> ls = new List<Account>{new Account(name='Acme Inc.'),new Account(name='Acme')};
insert ls;
................................
...............//This line generate the error
List<Contact> ls = new List<Contact>{new Contact(name='Classic Inc.'),new Contact(name='Classic')};
insert ls;
......................
}
.........................
}
The same fails for Lead too.
What I want to achieve is run the code example as given in the below mentioned link for Account, Lead and Contact.
Following is the ref documentation link
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_merge.htm
Thanks
Hector....
i wonder how this line works fine
the mistake is right there how can make a list of account and instantiate contact. comment this line and run.
Sorry, my mistake. I have corrected the statement. The Account object is accessible but Lead and Contact are not.
Please use one thread for this:
http://community.salesforce.com/t5/Apex-Code-Development/Merge-not-working-on-Contacts-and-Leads/m-p/196295/highlight/false#M33096