5

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...?

4
  • Are you looking at the line USER_DEBUG ? because in the log there are so many similar lines.
    – highfive
    Commented Dec 1, 2014 at 5:33
  • yes I am, i add the text manza just before displaying the result
    – manza
    Commented Dec 1, 2014 at 5:56
  • Have you found any solution? I'm going throw the same problem. Thanks! Commented Oct 26, 2015 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
    Commented Oct 27, 2015 at 0:07

1 Answer 1

4

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .