You need to sign in to do that
Don't have an account?
chandra prakash 58
need to write a trigger using handler class.
I have three custom object target__c and targetLine__c, employee__c.
In target __c i have a field name employee__c(lookup) with employee__c object.
in Employee__c have a self lookup field name manager__c.
now,
Criteria: when record creates in target__c object.
Action: automatically crate the record in targetline__c based upon the employee. (e.g. if in an employee is the manager of three other employees then. then create three orderLine__ record.)
In target __c i have a field name employee__c(lookup) with employee__c object.
in Employee__c have a self lookup field name manager__c.
now,
Criteria: when record creates in target__c object.
Action: automatically crate the record in targetline__c based upon the employee. (e.g. if in an employee is the manager of three other employees then. then create three orderLine__ record.)
Greetings!
Please find the sample trigger and handler class in the below blog and make changes according to your requirement.
http://sfdccodepractices.blogspot.com/2017/07/trigger-and-its-handler-class-example.html
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri