You need to sign in to do that
Don't have an account?
Nikitha
hey I'm new to salesforce I want to copy Custom object variables to other Custom object variables using bulk triggers in anonymous window please help me
My first custom object Customer_Detail__c
coping object Dup_Customer_Detail__c
coping object Dup_Customer_Detail__c
You cannot copy the custom object variable but you can copy the field values. Here is an example
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Thanks for clarification about anonymous window . I have tried your code but Im not able to copy can say why. my code
trigger BulkCustomerDetailsName on Customer_Detail__c (after insert) {
set<id> Ids = new set<id>();
}
for(Customer_Detail__c customer : trigger.new){
Ids.add(customer.Id);
List<Customer_Detail__c> customerList = new List<Customer_Detail__c>([Select id,Name,Last_name__c from Customer_Detail__c
where Id in :Ids]);
for(Customer_Detail__c cus: customerList){
Dup_Customer_Detail__c dup1 =new Dup_Customer_Detail__c();
dup1.Name = cus.Name;
dup1.Last_Name__c = cus.Last_name__c;
insert dup1;
}
}