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
ArunaAruna 

Override "New" button with visualforce page and again on the visualforce page when button is clicked take to record type selection

Hi There,

I have situation where i need to override the "New" button with visualforce page  and again on the visulaforce when i click button it should do some business logic and open the record type selection page of overridden  object.

I have done the overriding the "New" button New button Override

if will open a visulaforce that is fine , when i click a button on visualforce page it is opening the record type selection page 
below is the URL which will take to record type selection page 
/setup/ui/recordtypeselect.jsp?ent=01Ie0000000DXBY&retURL=%2Fa1Z%2Fo&save_new_url=%2Fa1Z%2Fe%3FretURL%3D%252Fa1Z%252Fo

User-added image

once i click on the continue button again it is taking me to visualforce page.
below is the url which is taking me to vf page 

https://c.cs15.visual.force.com/apex/OverrideQuoteNewButton?retURL=%2Fa1Z%2Fo&RecordType=012e0000000D2XZ&ent=01Ie0000000DXBY&inline=1&save_new=1&sfdc.override=1

but what i was expect is standard page layout of quote.
can any one tell me what is url parameter i need to pass to go to standard quote edit page.

is it possible to get after overriding to get standard page layout.



Balaji BondarBalaji Bondar
Aruna,

passing sfdc.override=0 should work on the button click.
https://c.cs15.visual.force.com/apex/OverrideQuoteNewButton?retURL=%2Fa1Z%2Fo&RecordType=012e0000000D2XZ&ent=01Ie0000000DXBY&inline=1&save_new=1&sfdc.override=0
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
RamuRamu (Salesforce Developers) 
See if this post helps

http://salesforce.stackexchange.com/questions/41887/custom-save-new-button-with-redirect-to-record-type-selection-page

ArunaAruna
Nope i didn't get 

i have tryed with below url 

/setup/ui/recordtypeselect.jsp?ent=01Ie0000000DXBY&retURL=%2Fa1Z%2Fo&save_new_url=%2Fa1i%2Fe%3FretURL%3D%2Fa1i%2Fo


I am getting  ( below is the url which generatedo once i click on continue button on record type vie page)
 User-added image

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

Click here to return to the previous page.


Mani RenusMani Renus
Try this

newPage =new PageReference('/a00/e?retURL=%2Fa1Z%2Fo&RecordType=012e0000000D2XZ&ent=01Ie0000000DXBY&nooverride=1');

instead of  'a00' you have to give your object id
Chakradhari GadigeChakradhari Gadige
Hi ;

this was used for Opportunity Object. All URL perameter belogs to Opportunity only(Expalined)***

If you want to ReDirect to a Record Type Page Use:

***( 006 ​- opty ID Prefix, %2F006%2Fo - Return URL for Opty,    RecordTypeID - Your recordType Id , ent - Your Object Name.)

PageReference pgr = new PageReference('/006/e?retURL=%2F006%2Fo&RecordType='RecordTypeID'&ent=Opportunity&nooverride=1');

If you want to Land in Recordtype Selection and from there you want to Redirect Use:

       if( ApexPages.currentPage().getParameters().get('RecordType')== NULL){
    
        PageReference  pgr = new PageReference('https://XXXXXXXXX.cs18.my.salesforce.com/setup/ui/recordtypeselect.jsp?ent=Opportunity&retURL=%2F006%2Fo&save_new_url=%2F006%2Fe%3FretURL%3D%252F006%252Fo'); 

        }else{
        string rcrdtype = ApexPages.currentPage().getParameters().get('RecordType');
        pgr = new PageReference('/006/e?retURL=%2F006%2Fo&RecordType='+rcrdtype +'&ent=Opportunity&nooverride=1'); 
        }


Thanks
Chakri.