You need to sign in to do that
Don't have an account?
Medhanie Habte 37
Printing values in system.debug
Greetings all, I am adding a system.debug in my trigger and noticed that the values when running a debug are returing null.
My code is listed as
My code is listed as
system.debug(mte.Service_Member__r.FirstName + ' and ' + mte.Lead_Supervisor__r.LastName + ' will be getting their member term evaluation on ' + mte.Date_of_Review__c.format() + ' for member term ' + mte.Member_Term__c);
The output appears as
null and null will be getting their member term evaluation on 1/25/17 for member term a0Ig0000007iekyEAA
My goal is to get the output to appear as a value rather than null, the trigger works nicely no less, but still.
Hope it helps.
Joe and Jane will be getting their member term evaluation of
Hi Medhanie,
Yes output will be null, even records have data. Here is the explantion.
If you have trigger on contact object and you want to see the account name and id where contact has account field some value.So In the trigger we have only values of object on which trigger is written, If try to access any parent values then it will return null.
Hope this will help you :)
Thanks
799 The Coder.
All Answers
It is null because it contains no data. Does mte has Service_Member__r.FirstName and Lead_Supervisor__r.LastName values? Also, if it does not have values, how will it be displayed?
If it will work, then there is no wrong with your code.
Hi Medhanie,
Yes output will be null, even records have data. Here is the explantion.
If you have trigger on contact object and you want to see the account name and id where contact has account field some value.So In the trigger we have only values of object on which trigger is written, If try to access any parent values then it will return null.
Hope this will help you :)
Thanks
799 The Coder.