You need to sign in to do that
Don't have an account?
Brianna Bollettieri
Visualforce Pages - Making it record type specific and changing the way the page looks
I created a VF page and am using it in place of the standard opportunity screen. I currently am having two issues with it.
1. We have many different record types but I only want this visualforce page to apply to 2 of them.
2. Once I create a new record or enter an existing. The record always looks like it is on the edit page.
Any assistance would be greatly appreciated!
1. We have many different record types but I only want this visualforce page to apply to 2 of them.
2. Once I create a new record or enter an existing. The record always looks like it is on the edit page.
Any assistance would be greatly appreciated!
This VF page would be different from your existing form page. This page will control the redirection of your page to required page.
While you override, select the option of choosing the record type, which will be appended to the URL.
When you click next, the control will go to your VF page, here you can get the recordtype from the URL, using ApexPages.CurrentPage.getParameters().get(<urlparamname>);
Then in the controller you can make the controlled redirect.
Let me know if that helped.
Thank you for your response. I already overrode the New, Edit, and View buttons with my VF page. I keep getting an error when I try to create a record saying "Formula Expression is required on the action attributes."
This is my controller:
<apex:page >
public with sharing class opportunityRedirect {
private ApexPages.StandardController controller;
public String retURL {get; set;}
public String saveNewURL {get; set;}
public String rType {get; set;}
public opportunityRedirect(ApexPages.StandardController controller) {
this.controller = controller;
retURL = ApexPages.currentpage().getParameters().get('retURL');
rType = ApexPages.currentPage().getParameters().get('Intl Test');
}
public PageReference redirect(); {
PageReference returnURL;
// Redirect if Record Type corresponds to custom VisualForce page
IF(rType == 'Intl Test') {
returnURL = new PageReference('/apex/International_Opportunities');
}
}
</apex:page>
And the beginning of my VF page is
<apex:page standardController="Opportunity" extensions="OpportunityRedirect" action="{redirect}" >
I'm assuming the problem is within my controller but I'm not sure where.
Do mark my answer as best answer if it helped you
there is a semicolon in the class name, perhaps would have been a copy pasting error.. :)
Anyways :
Correct To
private ApexPages.StandardController controller; and this.controller = controller;
These are not required.
Please paste using <> on this editor tab
This is the VF page.
Were you able save the controller? :-|
Controller should be like this
Do correct that as well formula expression are always like {!____ }
skype : vineet_kumar1988