• #21256
    Salesforce | shariq shariq #1
    Forcetalks

    What are wrapper classes in Salesforce?

    Explain Wrapper class with examples?

     

    #21257
    Salesforce | Shubham Shubham #222
    Forcetalks

    Hi Shariq

    A wrapper or container class is a class, a data structure, or an abstract data type which contains different objects or collection of objects as its members.
    A wrapper class is a custom object defined by programmer wherein he defines the wrapper class properties. Consider a custom object in salesforce, what do you have in it? fields right? different fields of different data types. Similarly wrapper class is a custom class which has different data types or properties as per requirement. We can wrap different objects types or any other types in a wrapper class.

    In the Visualforce most important use case is to display a table of records with a check box and then process only the records that are selected.

    In the example below, we are displaying list of accounts with checkbox. End user can select account and then click on Show Selected accounts button. Then selected account will be displayed in table.

    Click here for example

    #34502
    Salesforce | Parul Parul #2
    Forcetalks

    A wrapper class is a custom object defined by programmer wherein he defines the wrapper class properties. Consider a custom object in salesforce, what do you have in it? fields right? different fields of different data types. Similarly wrapper class is a custom class which has different data types or properties as per requirement. We can wrap different objects types or any other types in a wrapper class.

     

     

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?