You need to sign in to do that
Don't have an account?
Mayank Upadhyaya 5
Batch apex to Update opportunity child record from Parent child record
Hi everyone i am new in apex . I have a requirement Batch where i need to Update all opportunity child record from Parent child record from batch apex . Parent opportunity and child opportunity have looke up relationship and look up field is composite_opportunity__c
i have condition where child records should be updated with the latest field values of Parent opportunity and batch apex should be run daily. These are below fields which need to update on child opportunity
Proposed_Net_PMPM_Revised__c, Proposed_GPMGIPM__c, Certified_Equipment__c, Total_Machines_Pockets__c, IncentivePayments__c, Betterments__c, VentingPlumbing__c, Wiring__c, Other_Capital__c, Capital_Total_Revised__c, Prev_Net_PMPM__c, IRR_2014__c, Lease_Term_Months__c, Monthly_Cashflow_VCI__c, Proposed_Gross_PMPM_Include_Inc__c, Average_Vend_Price__c, Midterm_Vend_Increase_Percentage__c, Prop_Gross_Monthly_Revenue__c, Scoring_Model_Total_Points__c, Proposed_Net_PMPM_VCI__c, Equipment_Total__c, Status__c, Capital_Coverage__c, Payback_Percentage__c, NRPM_Percentage__c, Commission_Percentage__c, Certified_Equipment_Percentage__c, Non_Equipment_Percentage__c, VCI__c, NPV_Cashflow_VCI__c, Months_Remaining_Existing_Contract__c, Override_Months_Remaining_New__c, Existing_Equipment_Count__c
Please let me know if anyone have sample code for this logic.
Thanks
i have condition where child records should be updated with the latest field values of Parent opportunity and batch apex should be run daily. These are below fields which need to update on child opportunity
Proposed_Net_PMPM_Revised__c, Proposed_GPMGIPM__c, Certified_Equipment__c, Total_Machines_Pockets__c, IncentivePayments__c, Betterments__c, VentingPlumbing__c, Wiring__c, Other_Capital__c, Capital_Total_Revised__c, Prev_Net_PMPM__c, IRR_2014__c, Lease_Term_Months__c, Monthly_Cashflow_VCI__c, Proposed_Gross_PMPM_Include_Inc__c, Average_Vend_Price__c, Midterm_Vend_Increase_Percentage__c, Prop_Gross_Monthly_Revenue__c, Scoring_Model_Total_Points__c, Proposed_Net_PMPM_VCI__c, Equipment_Total__c, Status__c, Capital_Coverage__c, Payback_Percentage__c, NRPM_Percentage__c, Commission_Percentage__c, Certified_Equipment_Percentage__c, Non_Equipment_Percentage__c, VCI__c, NPV_Cashflow_VCI__c, Months_Remaining_Existing_Contract__c, Override_Months_Remaining_New__c, Existing_Equipment_Count__c
Please let me know if anyone have sample code for this logic.
Thanks
Please try this Pseudo code and modify it accordingly :-
for more detail please refer below link :-
https://salesforce.stackexchange.com/questions/83408/how-to-update-all-child-record-in-the-system-using-parent-field-value-using-batc
regards,
Priya Ranjan