When I add an apex:inputField for a master-detail relationship it does not allow you to choose a parent via the lookup icon - it only shows the name of a parent if I append a record ID in the URL. If no record ID is specified, it only shows the name of the field, but no lookup icon.
Code:
<apex:page standardController="Scholarship_Award__c">
<h1>2020-2021 Academic Year</h1>
<apex:form >
<!-- Hi -->
<apex:pageBlock title="Add Scholarship Awards">
<apex:pageBlockSection columns="2">
<apex:inputField value="{!Scholarship_Award__c.Name}"/>
<apex:inputField value="{!Scholarship_Award__c.Year__c}"/>
<apex:inputField value="{!Scholarship_Award__c.Recipient__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
keyPrefix000000000000000
and a detail record (in memory) that points at the in-memory parent. b) then implement a controller extensionsave()
that verifies that a real parent was chosen.