You need to sign in to do that
Don't have an account?
Ab
Trigger is not able to get the values from the Parent objects
Hello,
I have below trigger
Thank you for suggestion !
I have below trigger
trigger temp on test__c (before update, before insert) { String one= ''; Id two; for (test__c obj : Trigger.new) { one = obj.Custom__r.one__c ; two = obj.Id; System.debug(one); //null System.debug(two); // has a Id System.debug(obj); // Custom__r gives a Id } }I am trying to get the "obj.Custom__r.one__c", this value is present but its alwys showing as null
Thank you for suggestion !
Try like this
All Answers
you cannot get parent values from trigger.new. For that you need to query it first.
Try like this