• Posted by Naresh kumar on October 9, 2019 at 1:47 AM

    trigger trigger_1 on Contact (before insert) {
    List<Contact>contacts= trigger.new;
    for(Contact c:contacts){
    c.name='naresh';
    }
    }

     

    As i am trying to to execute this code but it is not executing show Field is not writeable :contact.Name

    • This discussion was modified 6 years, 3 months ago by  Naresh kumar.
    • This discussion was modified 6 years, 3 months ago by  Naresh kumar.
    Nikita replied 6 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Nikita

    Member
    October 9, 2019 at 7:20 AM

    Hi,

    Contact Name is a composite field made of Salutation, FirstName & LastName. in your code, you need to set Firstname and Lastname and then the Name will be auto-generated from these 2 fields..

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Salesforce Admin Certification 2020 Questions Explained with References - Part II

Video in

How to prepare and pass Salesforce Admin Certification with Practice Exam Questions 2020 practice questions and answers for the Salesforce Administration Salesforce Certified Admin Exam Questions Salesforce Administrator Certification Exam…