You need to sign in to do that
Don't have an account?
Matthew Allen
Detail Page button to load VF page?
Hi,
Below is my VF page, but it isn;t available to me to direct a Detail Page button to it - can anyone help as to why?
Below is my VF page, but it isn;t available to me to direct a Detail Page button to it - can anyone help as to why?
<apex:page standardController="Custom_Object__c" recordSetVar="Opportunities" showHeader="false" sidebar="false"> <apex:sectionHeader title="eVA Qualification Form Edit" subtitle="New eVA Qualification Form"/> <apex:form> <apex:pageBlock title="eVA Qualification Form Edit" mode="edit"> <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Information" columns="2"> <apex:inputField value="{!Custom_Object__c.Opportunity__c}" required="true"/> <apex:inputField value="{!Custom_Object__c.OwnerId}" required="false"/> <apex:pageBlockSectionItem/> <apex:pageBlockSectionItem/> <apex:inputField value="{!Custom_Object__c.Website_URL__c}" required="true"/> <apex:inputField value="{!Custom_Object__c.Website_Visits_per_Month__c}" required="true"/> <apex:inputField value="{!Custom_Object__c.Existing_SAV_User__c}" required="true"/> <apex:pageBlockSectionItem/> <apex:inputField value="{!Custom_Object__c.Stock_Level__c}" required="true"/> <apex:pageBlockSectionItem/> <apex:inputField value="{!Custom_Object__c.Sales_per_Month__c}" required="true"/> <apex:inputField value="{!Custom_Object__c.Part_Exchange__c}" required="true"/> <apex:inputField value="{!Custom_Object__c.Number_of_Part_Ex_valuations_per_Month__c}" required="true"/> <apex:inputField value="{!Custom_Object__c.How_do_they_know_this__c}" required="false"/> <apex:inputField value="{!Custom_Object__c.Do_they_have_a_valuation_CAP_license__c}" required="true"/> <apex:pageBlockSectionItem/> <apex:inputField value="{!Custom_Object__c.What_are_thier_Business_objectives__c}" required="false"/> <apex:pageBlockSectionItem/> <apex:inputField value="{!Custom_Object__c.Consumer_Journey_thoughts__c}" required="false"/> <apex:pageBlockSectionItem/> <apex:inputField value="{!Custom_Object__c.Additional_Information__c}" required="false"/> <apex:pageBlockSectionItem/> </apex:pageBlockSection> <apex:pageBlockSection title="System Information" columns="2"> <apex:inputField value="{!Custom_Object__c.Name}" required="false"/> <apex:pageBlockSectionItem/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Greetings!
Can you please try by adding the below in the first line of the visualforce page to see,if it allows you to use the VF on the detail page button:
standardStylesheets="true"
Reference:https://developer.salesforce.com/forums/?id=9060G0000005jKlQAI
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Try adding apex;pagemessages in your vf code.
Please let us know if it doesn't help.
Remove recordSetVar="Opportunities" atrribute if you want to make it available from button.
Let us know if it doesn't work.
I want to load this VF page from the Opportunity Object. SO I want it to sit on the Opportunity page layout, and when pressed, it create this custom object record.
Sorry, I wasn't clear at all.
You can use your vf page by creating custom button on opportunity and Choose Content Source as URL
Add the below url
/apex/[yourpagename]
and you wil be able to use it on opportunity object.
If you use standard controller as opportunity then you have to use extension to add save functionality of your custom object through apex code.