function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MariPMariP 

Output field in a VF page, which is a lookup field, has no value

Hi everybody,

I have a master-detail relationship between 2 custom objects (Call_Plan_Line__c and Call_Plan_Line_Result__c). In the header of my page, I display datas from the master object, and particulary the name of the DC Center of the store, which is a lookup field to Account. This field is blank, although I know there is something in it (the Id of the account, I suppose).

 

Here is my code :

<apex:outputfield value="{!Call_Plan_Line__c.Delivery_DC__c}"/>

Here is the result :

 

I have tried this too :

<apex:outputfield value="{!Call_Plan_Line__c.Delivery_DC__r.Name}"/>

Here is the result :

 

Any help will be welcome !

 

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
MariPMariP

Hi Bob !

 

I have no problem with the field level security.

 

But I finally found a solution :

 

in the class :

in the constitution of the list of Call Plan Result, I added :

, Call_Plan_Line__r.Call_Plan_DC__r.Name

 

And in the VF Page :

<apex:outputfield value="{!Call_Plan_Line__c.Call_Plan_DC__r.Name}"/>

 

And now I see what I need to !

I am really a beginner on Sales Force, and it's quiet mysterious for me....

 

Anyway, thanks a lot for having answered !

Marie

All Answers

bob_buzzardbob_buzzard

Have you checked field level security etc?  If you have, try just outputting the raw value from the field to the page, e.g.

 

Delivery DC field = {!Call_Plan_Line__c.Delivery_DC__c}

 

If the lookup is populated, the ID of the Account will be displayed.

MariPMariP

Hi Bob !

 

I have no problem with the field level security.

 

But I finally found a solution :

 

in the class :

in the constitution of the list of Call Plan Result, I added :

, Call_Plan_Line__r.Call_Plan_DC__r.Name

 

And in the VF Page :

<apex:outputfield value="{!Call_Plan_Line__c.Call_Plan_DC__r.Name}"/>

 

And now I see what I need to !

I am really a beginner on Sales Force, and it's quiet mysterious for me....

 

Anyway, thanks a lot for having answered !

Marie

This was selected as the best answer
sebascansecosebascanseco

Would you please be more specific with your solution? Exactly what do you mean by:

 

in the constitution of the list of Call Plan Result, I added :

 

Where did you wrote that in the class? Thank you!