• 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 4 years, 7 months ago by  Naresh kumar.
    • This discussion was modified 4 years, 7 months ago by  Naresh kumar.
    Nikita replied 4 years, 7 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