+ Start a Discussion

Problem with a custom page replacing a wizard page that is in a managed package

I have a controller and a set of default wizard pages that use that controller in a managed package. I have added a custom setting to the managed package to allow one of the default pages to be replaced. The intention is to allow a developer building on the managed package to replace that page in their org with a custom version but still use the controller in the managed package (that has global methods).


When I run using the default page (that is in the managed package) everything works suggesting that the profile including the Field Level Security (FLS) settings is correct.


But when I run using a copy of the default page only changed to add the managed package namespace prefixes (that is not in the managed package) while a non-SObject field is rendered all SObject fields (including fields on the User object) from SObjects returned by the controller are rendered.


Any insights into what is going on here or what I might be missing would be appreciated.




PS With further debugging, this is now looking like a wizard-specific problem. In a wizard, multiple pages share an instance of a controller so that view state is carried from one page to the next. But it appears that when the custom page opens it gets a new instance of the controller rather than the existing one and so various SObject references are null because the selections made in the earlier pages have been lost. Can anyone confirm this behaviour and offer and work-arounds?