You need to sign in to do that
Don't have an account?
saimounika
Issue with Restrict Reflective Access to Non-Global Controller Constructors in Packages critical update
Hi,
My lightning component and apex class are not a part of managed package and they are public. However i am still getting the "ApexType does not have a no-arg constructor" error after enabling this critical update.
I am getting this error when i am passing the wrapper class list from lightning component to apex class.So, I have serialzed the wrapper class in lightning component and deserialized in apex class. Then the issue got fixed.
Anyone else faced the same issue ? Why I am facing this issue with component which are not a part of managed packages/namespace?
Is this a valid fix?
Thanks!
My lightning component and apex class are not a part of managed package and they are public. However i am still getting the "ApexType does not have a no-arg constructor" error after enabling this critical update.
I am getting this error when i am passing the wrapper class list from lightning component to apex class.So, I have serialzed the wrapper class in lightning component and deserialized in apex class. Then the issue got fixed.
Anyone else faced the same issue ? Why I am facing this issue with component which are not a part of managed packages/namespace?
Is this a valid fix?
Thanks!
Review below link which has similar issue and try workaround mentioned.
https://salesforce.stackexchange.com/questions/312706/critical-update-error-now-showing-up
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
The blog is having a solution for managed package. My issue is different here.
Thanks!
We ran into the same issue while passing a wrapper list from aura controller to apex. Can you share how you serialized and deserialized the wrapper list to solve this?
We have serialized the list in aura controller as below :
paramToApex:JSON.stringify(component.get("/your parameter/"));
And deserialized in apex class as below
List<wrapperCls>wrpLst=new List<wrapperCls>();
wrpLst=(List<wrapperCls>)JSON.deserialize(paramToApex,List<wrapperCls>.class);
Also ,you have to change the apex class input parameter type to string(In the above syntax the string parameter is "paramToApex") as we are serializing and sending in aura.Hope this helps :)
Thanks,
Mounika