3

I am not sure if I am missing something but I am doing the query below and for some reason it is not displaying in the result the relationship fields requested, while when I do it from the developer console it works fine.

My query looks like this:

registrations = [Select Id, Name, miiEventV1__Status__c, miiEventV1__Client__r.Name, miiEventV1__Client__r.PersonMobilePhone, miiEventV1__Client__r.PersonEmail, miiEventV1__Client__r.PersonHomePhone,miiEventV1__Client__r.Email_Subscriptions__c ,miiEventV1__Client__r.Client_Manager__c From miiEventV1__Registration__c LIMIT 1];

My debug log looks like this:

system.debug('@@@@'+registrations); displays: DEBUG|manza(miiEventV1__Registration__c:{Name=REG0016109, RecordTypeId=01290000000G2OOAA0, miiEventV1__Client__c=001N000000LnHirIAF, Id=a0AN0000002s1SDMAY, miiEventV1__Status__c=Registered})

In the developer console: enter image description here

I dont understand what is happening, why the debug log is not getting the fields miiEventV1__Client__r...?

  • Are you looking at the line USER_DEBUG ? because in the log there are so many similar lines. – highfive Dec 1 '14 at 5:33
  • yes I am, i add the text manza just before displaying the result – manza Dec 1 '14 at 5:56
  • Have you found any solution? I'm going throw the same problem. Thanks! – Airton Gessner Oct 26 '15 at 18:53
  • Hi Airton, it was pretty weird the next day worked fine. I don't recall changing any of the field level security for the profile, but maybe if I where you I would start looking if the fields in the query are allow in your profile (I meant if the user has access to that field). I hope this helps! – manza Oct 27 '15 at 0:07
3

The debug logs will only show the Foreign Key when you debug the sObject like you have.

If you

system.debug(registrations. miiEventV1__Client__r.Name);

You Should See the name being output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.