You need to sign in to do that
Don't have an account?
MattyRay
Opening/Close child record(s) on Opportunity Save.
Hello,
So I'm new to apex...
We have a formula field on the opportunity called "department", which is formulated from another lookup relationship to an object called "Employee". Obviously, The department value changes as the lookup "Employee" value is changed.
Here's the issue. We have a child object (related to the opportunity) called "Financial Data". For several reasons, I need to open/close the child "financial data" record everytime the opportunity is saved.
Does anyone know of a quick trigger to do this? Test Coverage class would also be appreciated.
Thanks!
OK, I was able to finish this and it works great.
trigger UpdateFinancials on Opportunity (after update) {
For(Opportunity Deal: Trigger.New){
List<Financial_Data__c> Financials =[select Id ,Deal__R.Id, DepartmentText__c from Financial_Data__c where Deal__c=:Deal.Id];
update Financials;
}
}