You need to sign in to do that
Don't have an account?
Carl Mah
New/Edit Mode - Display text
Hi
I want to display specific text when a user creates a new record and also when on edit mode. The section called MBO Guide VF page" needs to have the below text and background colour when creating a record and also on edit mode. Please see section marked in bold.
Below is the code but it's not appearing when the user creates a new record (before saving for the first time) and or when on edit mode.
(Note - I'm a novice on VF so please excuse any school-boy mistakes)
Thanks in advance!
<apex:page standardcontroller="Managers_MBO__c">
<apex:messages />
<apex:sectionheader title="{!$ObjectType.Managers_MBO__c.label} Edit" subtitle="{!IF(ISNULL(Managers_MBO__c.Name), 'New Managers MBO',Managers_MBO__c.Name)}"/>
<apex:form >
<apex:pageblock mode="edit" title="{!$ObjectType.Managers_MBO__c.label} Edit">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!Save}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockbuttons>
<!-- ********** [Record Type : Master ] ********** -->
<apex:outputpanel >
<apex:pageblocksection title="MBO Guide VF Page" showheader="true" columns="1">
<!-- Start of guide section -->
<style>
body {
background-color: #B0C8C9 !important;
}
</style>
<br></br>
<centre>
<apex:outputText value="NOTE : Please add as much intelligence / information as possible to the description of the Value Add so that it is clear
what activity has taken place, with who and how long this took to deliver." style="font-size:12px"/>
<br></br>
</centre>
<br></br>
<!-- End of guide section -->
<!-- Start of relevant fields-->
</apex:pageblocksection>
<apex:pageblocksection title="Information" showheader="true" columns="2">
<apex:inputfield value="{!Managers_MBO__c.MVA_Value_Add_Type__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Description_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Date_Time_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Location_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Duration_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Astute_Campaign__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Associated_CompanyIDOnlyMBOcalls__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MAV_Link_to_your_Publish_Lead__c}" required="false"/>
<apex:pageblocksectionitem />
</apex:pageblocksection>
<apex:pageblocksection title="System Information" showheader="true" columns="2">
<apex:pageblocksectionitem />
<apex:outputfield value="{!Managers_MBO__c.OwnerId}"/>
<apex:pageblocksectionitem />
<apex:outputfield value="{!Managers_MBO__c.Name}"/>
</apex:pageblocksection>
</apex:outputpanel>
</apex:pageblock>
</apex:form>
<center><br/>
</center><br/>
</apex:page>
I want to display specific text when a user creates a new record and also when on edit mode. The section called MBO Guide VF page" needs to have the below text and background colour when creating a record and also on edit mode. Please see section marked in bold.
Below is the code but it's not appearing when the user creates a new record (before saving for the first time) and or when on edit mode.
(Note - I'm a novice on VF so please excuse any school-boy mistakes)
Thanks in advance!
<apex:page standardcontroller="Managers_MBO__c">
<apex:messages />
<apex:sectionheader title="{!$ObjectType.Managers_MBO__c.label} Edit" subtitle="{!IF(ISNULL(Managers_MBO__c.Name), 'New Managers MBO',Managers_MBO__c.Name)}"/>
<apex:form >
<apex:pageblock mode="edit" title="{!$ObjectType.Managers_MBO__c.label} Edit">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!Save}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockbuttons>
<!-- ********** [Record Type : Master ] ********** -->
<apex:outputpanel >
<apex:pageblocksection title="MBO Guide VF Page" showheader="true" columns="1">
<!-- Start of guide section -->
<style>
body {
background-color: #B0C8C9 !important;
}
</style>
<br></br>
<centre>
<apex:outputText value="NOTE : Please add as much intelligence / information as possible to the description of the Value Add so that it is clear
what activity has taken place, with who and how long this took to deliver." style="font-size:12px"/>
<br></br>
</centre>
<br></br>
<!-- End of guide section -->
<!-- Start of relevant fields-->
</apex:pageblocksection>
<apex:pageblocksection title="Information" showheader="true" columns="2">
<apex:inputfield value="{!Managers_MBO__c.MVA_Value_Add_Type__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Description_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Date_Time_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Location_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Duration_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Astute_Campaign__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Associated_CompanyIDOnlyMBOcalls__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MAV_Link_to_your_Publish_Lead__c}" required="false"/>
<apex:pageblocksectionitem />
</apex:pageblocksection>
<apex:pageblocksection title="System Information" showheader="true" columns="2">
<apex:pageblocksectionitem />
<apex:outputfield value="{!Managers_MBO__c.OwnerId}"/>
<apex:pageblocksectionitem />
<apex:outputfield value="{!Managers_MBO__c.Name}"/>
</apex:pageblocksection>
</apex:outputpanel>
</apex:pageblock>
</apex:form>
<center><br/>
</center><br/>
</apex:page>
All Answers
Please see below code:
apex:page standardcontroller="Managers_MBO__c">
<apex:messages />
<apex:sectionheader title="{!$ObjectType.Managers_MBO__c.label} Edit" subtitle="{!IF(ISNULL(Managers_MBO__c.Name), 'New Managers MBO',Managers_MBO__c.Name)}"/>
<apex:form >
<apex:pageblock mode="edit" title="{!$ObjectType.Managers_MBO__c.label} Edit">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!Save}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockbuttons>
<!-- ********** [Record Type : Master ] ********** -->
<apex:outputpanel >
<apex:pageblocksection title="Guide VF Page" showheader="true" columns="1">
<!-- Start of guide section -->
<apex:outputPanel layout="block" style="background-color: #B0C8C9 !important;">
<apex:outputText
value="NOTE : Please add as much intelligence / information as possible to the description of the Value Add so that it is clear
what activity has taken place, with who and how long this took to deliver."
style="font-size:12px; "/>
</apex:outputPanel>
</apex:pageblocksection>
<apex:pageblocksection title="Information" showheader="true" columns="2">
<apex:inputfield value="{!Managers_MBO__c.MVA_Value_Add_Type__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Description_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Date_Time_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Location_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Duration_of_Activity__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Astute_Campaign__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MVA_Associated_CompanyIDOnlyMBOcalls__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Managers_MBO__c.MAV_Link_to_your_Publish_Lead__c}" required="false"/>
<apex:pageblocksectionitem />
</apex:pageblocksection>
<apex:pageblocksection title="System Information" showheader="true" columns="2">
<apex:pageblocksectionitem />
<apex:outputfield value="{!Managers_MBO__c.OwnerId}"/>
<apex:pageblocksectionitem />
<apex:outputfield value="{!Managers_MBO__c.Name}"/>
</apex:pageblocksection>
</apex:outputpanel>
</apex:pageblock>
</apex:form>
<center><br/>
</center><br/>
</apex:page>
Mine is looking something like this.
My mistake - I didnt align that VF edit page to be the default new/edit page in the custom object settings.
It's working now!
Thanks for the quick response!