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
Siva SakthiSiva Sakthi 

trigger code for send one object record details to another object? Send Some codes

 

 

trigger code for send one object  record details to another object?

 

Send Some Sample codes

Ana Catarina BritesAna Catarina Brites

Hello Maheshwar,

 

You want something like this?! Or does the second object already existes in Salesforce? 

 

trigger DoAction on Object1__c (before insert) {

    for (Object1__c c:trigger.new){
        if(condituon==true){
            Object2 obj2 = New Object2();
obj2.att1__c = c.att1__c;
obj2.att2__c = c.att2__c try{ insert (obj2); }catch(exception ex){} } } }