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
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