You need to sign in to do that
Don't have an account?
Overridden Opp New/View/Edit now cannot change Record Type
Hi all,
Major problem. We have overridden the opportunity new, view and edit controls and visualforced all opportunity view and edit pages. In the visualforce I have added the [change] link next to the Record Type on the view page.
When I click the change link next to the record type and choose a type from the drop down then click continue, it takes me back to the view page (which I would expect) but the record type has not changed:
Also on another page I'm just using the detail tag (thereby not writing the [change] link manually) and it still doesnt work. Seems to me the problem is caused because the Edit function is overwritten with a visualforce page. The record type change page is managed by a jsp page but it would seem the owner isnt actually changed here and somehow it is passed somewhere else once the Continue button is clicked but because we have overridden view and edit, whatever process that would normally handle the record type change is now no longer being called.
Seems strange that salesforce would give me the option to override these pages when it clearly leads to a problem of this kind, can anyone offer a suggsetion?
Thanks
Steven
noone can offer an opinion?
So I want to override the Edit page using this
So when a user wants to save any changes to the Opportunity, I want to go through some logic and determine whether to send some statistical information to Google Analytics.
All this seems to work okay, but users have started noticing that when the Edit button is overridden, their ability to modify the Record Type on the Opportunity is no longer available.
The button to change the Record type [change] is still there, and selecting the record type is still works, but normally after selecting the record type, you're taken to the edit page for any additional editing. The record type displayed on the Edit page is the same as the original record type and not the new one that is selected.
I tried adding the recordtype to the URL by going like this (bolded)
and that passes the NEW recordtype ID to the edit page in the URL
but the page still displays that the record type is still the original one. And when you save it, the record type is unchanged.
How do you get the new record type to be recognized by the edit page if you've overrode the Edit button?
The solution was found here:
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008pZoIAI
Essentially, if I tried getting the Record Type by using opportunity.recordtype, it would return the ORIGINAL record type value.
It's not clear that this happens, but the selected Record Type is actually passed to the edit page via URL parameter, but things happen so fast that you don't see it.
I had to modify the link in my previous post to grab the record type from the URL parameter and only then did the Edit page display the selected and correct value.
Here is the modified code:
and the getURLParameter function is as follows:
This will take you to the default Edit page with the selected Record Type that was done in the Record Type selection page.
I hope this helps anyone who is running into the same issues as the original poster and me.