You need to sign in to do that
Don't have an account?

How to pass more than 32 parameters to wrapper class constructor
Hi there,
I am having wrapper class in apex class, i need to pass more than 32 (like 40) parameters to wrapper constructor.
When i was passing more than 32 parameters I am getting you cannot pass more than 32 parameters to wrapper constructor.
Can anyone please tell how can i pass more than 32 parameters?
Any idea or sample please.
Thank you,
Hi,
Write auto implement properties for all member variable.
or
what you bind paas as an object like you bind Contact and Account object to wrapper class
public WrapperClass(Contact objCon,Account objAcc)
{
//bind here value
}
Here's an idea:
Combine parameters of similar types into arrays and pass the arrays instead of the individual parameters. For example, instead of:
you could do this:
Calling the constructor would look like this:
My example uses only three parameters, but you could use this technique to reduce your 40 parameters to some number less than 32.
If this helps, please mark it as a solution, and give kudos (click on the star) if you think I deserve them. Thanks!
-Glyn Anderson
Certified Salesforce Developer | Certified Salesforce Administrator