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
mramosmramos 

Issue with New button override for Opportuntiy

Hello,

I have an Opportunity New button that overrides the std New button, but it is behaving incorrectly . The button works by taking the user to the recordtypeselection with some parameters to passthrough, as so:

/setup/ui/recordtypeselect.jsp?ent=Opportunity&retURL={!Account.Id}&save_new_url=/{!("/006/e?accid="+Account.Id+"&opp3="+LEFT(Account.Name, 30))}

The New Opp page is overriden with a custom VF page that will first run a redirect action method, so that users creating an "RP" opportunity will be taken to the standard page while the rest will remain in the custom opp edit page. There is a profile "Sales Rep" that has only access one record type and not RP and an "RP Sales Rep" with access only to RP recordtype. 

When a User with several recordtype access clicks the button it is fine since they are taken to the recordtypeselect page and then the parameters are sent to the VF page.

The problem is that some users do not have access to the recodtypeselect page since they only access one recordtype as default and therefore are taken directly to the new default opp page and the parameters are not added. How can I overcome this????

User with multiple rec type access new Opp URL: 
https://c.cs22.visual.force.com/apex/OppOverrideEdit?accid=00117000006ZY5X&opp3=Test+SR+acc&RecordType=01220000000DzLl&ent=Opportunity&save_new=1&sfdc.override=1

User with only one default recordtype, new opp page url (this is the one not working):
https://c.eu0.visual.force.com/apex/OppOverrideEdit?ent=Opportunity&save_new=1&sfdc.override=1
 
Suneel#8Suneel#8
So here issue is that Users will have a provision to select some parameters in Record Type selection page which users with access to only one record type are not able to get to.Am I right?