[SalesForce] The lookup field is not displaying on VF page

My VF page will display list of records of custom objects. In the page I am adding input lookup field. When I added to the VF page it is showing empty. It is displaying all fields except Lookup field.

But if I replace the custom object to Contact in the controller and in the page if I add as <apex:inputText id="Contact" value="{!rec.contact__c}" /> It is displaying lookup to the Account. I don't no why it is not showing for custom object.

Controller :

public class lookup{

  public Records__c rec{get;set;}

  public lookup(ApexPages.StandardController controller) {

  rec = new Records__c ();
  }

}

Page:

<apex:page standardController="Account" extensions="myclass,lookup" >
<apex:pageBlockTable value="{!list }" var="li" id="tablId"> <!-- I am getting this values from other class -->
            <apex:column headerValue="Name">
                <apex:outputText >
                {!wl.Name}
                </apex:outputText>
             <apex:column headerValue="Contact">
              <apex:inputText id="Contact" value="{!rec.contact__c}"  />
              </apex:column>

</apex:pageBlockTable>     

Best Answer

Sounds like a permissions issue. You need to verify that the user has edit access to:

  1. The lookup field
  2. The object being looked up to

If they can edit both of these, they should be able to set the lookup on your page.

Related Topic