You need to sign in to do that
Don't have an account?

Can I update a great-parent object with a trigger?
Is that even a real relationship? Great-parent?!? :P
I'm trying to cause an update of an object that isn't directly related to another. In this case, Project>Case>Return Line Item. If there's a change in the Actual Unit Credit to Customer on the Return Line Item, I need the new amount to update on the project.
I can make this work if I add a lookup for the Project to the Return Line Item, but I don't want to. This would be a huge training issue for us as we use this information for financial reporting.
Works with: rli.Project__c, but not with rli.RMA_Case__r.Project__c. Any ideas?
trigger RLIOverrideValue on Return_Line_Item__c (after update) { set<id> projectIDs = new set<id>(); If(trigger.isUpdate){ for (Return_Line_Item__c rli: Trigger.new){ try{ if(rli.RMA_Case__r.Project__c != null && rli.Actual_Unit_Credit_to_Customer__c != trigger.oldMap.get(rli.ID).Actual_Unit_Credit_to_Customer__c){ projectIDs.add(rli.RMA_Case__r.Project__c); } }catch(exception e){ projectIDs.add(rli.RMA_Case__r.Project__c); } } if(projectIDs.size() >0){ rli_Handler.updateProjectPendingRMA(projectIDs); } } }
~Mander
you need to query for "rli.RMA_Case__r.Project__c "
I'm still really new at this and I can't figure out how to query for "rli.RMA_Case__r.Project__c ". Do you have any suggestions?
It still isn't working. Can you be more specific, please?
I figured it out. Thanks for your help.