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
Keith987Keith987 

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.

 

Keith

 

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?