You need to sign in to do that
Don't have an account?
renuami
relationships inside a trigger for loop
Hi -
Travel__c custom Object is the related list under Opportunity. When i try to grab the AccountId from Opportunity using child relationship the value is coming as null. When i query the same in Apex explorer i am getting the results.
Please advise what is wrong here?
trigger test_sample on Travel__c (after update,after insert) { if(trigger.isAfter) { if(trigger.isUpdate)
{ for(Travel__c t:Trigger.new) { system.debug('Opportunity AccountId Value '+t.Opportunity__r.Account.Id); } } } }
This blog post should explain it for you...
Relationship Lookup Objects in Triggers are NULL?
Jeff Douglas
Appirio, Inc.
http://blog.jeffdouglas.com
Author: The Salesforce Handbook
All Answers
This blog post should explain it for you...
Relationship Lookup Objects in Triggers are NULL?
Jeff Douglas
Appirio, Inc.
http://blog.jeffdouglas.com
Author: The Salesforce Handbook
Thanks a bunch. Logic worked for me!!!