I have two objects SFDC_PTO_Request__c (child),Employee__c (parent) with Master-Detail relationship. I need to display parent on child record while inserting on visualforce page which was a lookup relationship. I am trying as below

<apex:page standardController="SFDC_PTO_Request__c" recordSetVar="SFDC_PTO_Request" sidebar="false">
 <apex:form >
 <apex:pageBlock title="Leave Request Edit">
 <apex:pageBlockButtons >
     <apex:commandButton action="{!Save}" value="Save"/>
     <apex:commandButton action="{!Cancel}" value="Cancel"/>
 <apex:pageBlockSection title="Information" columns="2" collapsible="false">
      <apex:inputField value="{!SFDC_PTO_Request__c.Type_of_leave__c}"/>
      <apex:inputField value="{!SFDC_PTO_Request__c.Available_Casual_Leaves__c}"/>     
      <apex:inputField value="{!SFDC_PTO_Request__c.Available_Sick_Leaves__c}"/>   
      <apex:inputField value="{!SFDC_PTO_Request__c.Request_Type__c}"/>   
      <apex:inputField value="{!SFDC_PTO_Request__c.Employee__c}"/>
  <apex:pageBlockSection title="Request Dates" columns="2" collapsible="false">
      <apex:inputField value="{!SFDC_PTO_Request__c.Request_Start_Date__c}"/>
      <apex:inputField value="{!SFDC_PTO_Request__c.Request_End_Date__c}"/>  

enter image description here

could some one help me to display the lookup field of parent on child record

  • Have you confirmed that Field Level Security is set properly for the Employee field? Commented Sep 14, 2014 at 15:04

1 Answer 1


That's a bit strange... can you confirm the user you are testing this on has the ability to view the parent Sobject / record? Also there's a sharing setting on the field which is the master detail relationship, ie: Employee__c is set properly. If they are allowed to see the parent record but no modify it you'll have to change the sharing setting to read only.

Lastly, master-detail relationships are always required so there's no way its read only. If this is a standard lookup, make sure it's not limiting your user that you are testing as to only see it as read only.

  • employee__C has all the permissions to view for all the users. there is no restriction for it Commented Jul 15, 2014 at 18:20
  • This is the field looking up to the parent, but what about the parent object itself? Is it deployed, does the user you are testing as have access to the parent table?
    – Double A
    Commented Jul 15, 2014 at 19:21
  • Both Employee and Leave Request object were in deployed status.I have Admin permissions of both these objects. Read, Create, Edit, Delete, View All, Modify All, View Setup, Edit Setup, Delete Setup all were given Commented Jul 17, 2014 at 18:46

You must log in to answer this question.

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