+ Start a Discussion
Naveen SanaNaveen Sana 

how to pass wrapper class as parameter to another method which is in another class in apex?

I have a wrapper class and we are deserializing the JSON data, and now we have to send that wrapper class to another method which is in another class.

 1. Q1)How we have to send it as a parameter? 
 2. Q2)How to access it in another class?

This is what our approach till now.
 
JSONWrapper mapRequest1 = (JSONWrapper) JSON.deserialize(request.requestBody.toString(),JSONWrapper.class);

 - JSONWrapper --- Name of the Wrapper class

 - request --- Contains Json data
   
 - mapRequest1 --- Contains Deserialized data
 
Uttpal chandraUttpal chandra
Hi Naveen,

Just go through the bleow link it will solve your query 
https://salesforce.stackexchange.com/questions/281159/how-to-pass-wrapper-class-as-parameter-to-another-method-which-is-in-another-cla


Kindly mark it as solved it solved your query.
Uttpal Chandra