2

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>     
7
  • 2
    Sounds like a permissions issue. Does the user you are testing with have permission to view that field and object?
    – Adrian Larson
    Commented Sep 22, 2016 at 20:55
  • @AdrianLarson yes I checked field visibility he has permission
    – Learner
    Commented Sep 22, 2016 at 21:46
  • What about the object in question?
    – Adrian Larson
    Commented Sep 22, 2016 at 21:52
  • did you try inputField instead?
    – Carlos
    Commented Sep 22, 2016 at 22:49
  • @Carlos yes I tried but still it is not showing.
    – Learner
    Commented Sep 23, 2016 at 13:01

1 Answer 1

0

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.

You must log in to answer this question.

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