3 risposte
Hi Dilip Kulkarni 12,Please try below trigger. I think this may help you.
trigger FilOwner on service_contract__c(After insert) {
list<service_contract__c>lstservicecontract = new list<service_contract__c>();
service_contract__c oServicecontract;
if(trigger.isAfter){
system.debug('@developer-->After:');
if(trigger.isInsert){
system.debug('@developer-->isInsert:');
for(service_contract__c oSC:trigger.new){
oServicecontract = new service_contract__c();
oServicecontract.Id = oSC.Id;
oServicecontract.Owner = oSC.CreatedById;
lstservicecontract.add(oServicecontract);
system.debug('@developer-->oServicecontract:'+oServicecontract);
}
if(lstservicecontract.size()>0){
update oServicecontract;
}
}
}
}
Thanks
Hemant