Skip to main content
1 risposta
  1. 14 nov 2022, 03:08
    Hi Piyush,

    try with below code. modify the field api Names and object names

    trigger testrecordinsert on customer__C (before update) {

    List<test_object__c> inserttestrecords = new List<test_object__c>();

    for(customer__C ctr:trigger.old){

    test_object__c to = new test_object__c();

    //you assign the list of fields you want to insert in the object from customer__c object.

    to.Name = ctr.name;

    to.field1__c = ctr.field1__c;

    to.field2__c = ctr.field2__c;

    inserttestrecords.add(to);

    }

    insert inserttestrecords;

    }

    If this helps, Please mark it as best answer.

    Thanks!!
0/9000