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
Sam.arjSam.arj 

inputField does not set the default value of the related object

In my solution "candidate" and "Resume" objects has master-detail relationship.

I am trying to replace the standard "edit" and "Insert" interface of my "Resume" custom object for the obvious reasons "rich text support" and unlike the Resume's standard insert page my VF page (inputField) is not setting the Candidate value of the "Resume" object automatically when i click on the "insert" button in Candidate detail page!

How can fix this?

below is the VF page code:


<apex:page standardController="Resume__c">
<apex:sectionHeader title="Edit Resume" subtitle="{!Resume__c.name}"/>
    <apex:form >
        <apex:pageBlock title="Edit/Insert Resume" id="thePageBlock" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>               
            </apex:pageBlockButtons>
          
            <apex:pageBlockSection title="Basic Information">
                    <apex:inputField value="{!Resume__c.name}" required="true"/>
                    <apex:inputField value="{!Resume__c.Candidate__c}"/>
           </apex:pageBlockSection>
          
            <apex:pageBlockSection title="Resume Content" columns="1">
            <div style="background-color: #FFFFFF; height:100%; width:100%;">
                <apex:inputTextarea value="{!Resume__c.Content__c}" required="true" richText="true"></apex:inputTextarea>
            </div>
            </apex:pageBlockSection>
        </apex:pageBlock>

    </apex:form>
</apex:page>

gv007gv007
<apexage standardController="Resume__c">
can you explaian me why you are useing Resume__c in the standard controller?
Sam.arjSam.arj
Every custom object has a standard controller and since i want my VF page to carry out tasks such as Insert and Update of resume object then naturally I should use the Resume__c standard controller.

I do not see anything wrong with that and what seems to be the problem is that when override the Edit and insert buttons of the "Resume__c" to open my VF page instead of the built-in version and then for example click on Resume__c list button "New" when i am in Canadidate__c page the inputField which is hooked to Candidate__c in my Resume__c VF page does not show the Candidate name.

possibilities:
1) I did not override the button correctly
2) I can not use one VF page for both "Insert" and "Edit" (a bit odd then i would need to create a duplicated page with same code)
3) I did not configure/initialize the inputField control properly
4) This is a bug or not supported by SF
scottious888scottious888
I'm also having this problem. Did you manage to get it sorted out?