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
dannodanno 

Dynamically select controller extension

I would like to have my page select the controller extension for the controller based on a parameter passed in the url, can this be done? If so what is the method?

 

Thanks :)

Dhaval PanchalDhaval Panchal
Very interesting requirement. Please update this with answer if you get some standard solution.

You can create on main class which redirect control to other controllers.

for example

you have Page1 with controller Ctrl1

in ctrl1 there should be a logic which call required functions from other controls.
souvik9086souvik9086

Controller extension cannot be selected dynamically from the parameter passed in the URL, You need to give static names in the extensions. However within that extension you can check from the parameter if something then call that class from there.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

Ajay_SFDCAjay_SFDC

Hi there ,

 

It is an awesome idea. In one of my project I am able to set contentType dynamically through button click and constructor. Let me give a try for the constructor !!