You need to sign in to do that
Don't have an account?
chaitanya motupalli
why child record is not generating when parent record is inserted as per below code? is there any mistake?
In the below trigger account(parent) and wow(child object) connected through a lookup already. Still, I can not create a record on wow object.
trigger AccPhone on Account (after insert) {
for(account a: trigger.new){
wow__c w= new wow__c();
w.name='chaitusri';
w.phone__c='545454';
w.WowAccount__c= a.id;
}
}
trigger AccPhone on Account (after insert) {
for(account a: trigger.new){
wow__c w= new wow__c();
w.name='chaitusri';
w.phone__c='545454';
w.WowAccount__c= a.id;
}
}
As this trigger is for event after insert so we need to use DML statement. Please try below code, Thanks,
Govindaraj.S
All Answers
As this trigger is for event after insert so we need to use DML statement. Please try below code, Thanks,
Govindaraj.S