You need to sign in to do that
Don't have an account?
Sam.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>
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>
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