Salesforce Developer Tutorial: How to use Wrapper Classes in Apex to Simplify your Integrations

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 27

  • @ignaciomartin3640
    @ignaciomartin3640 3 роки тому +3

    really good information , i learned this doing my official first integration some days ago , so i can tell this is really helpful.

    • @CodingWithTheForce
      @CodingWithTheForce  3 роки тому +1

      Thanks man! I’m glad you liked it and I appreciate the feedback!

  • @slackularo
    @slackularo 3 роки тому +1

    Nice work, Matt. This is a great explanation of wrapper class use and an introduction to json2apex.

  • @danieljeffrey3269
    @danieljeffrey3269 3 роки тому +3

    Great video! Well organized and informative! You have a talent for teaching.

  • @jean-francoiscarrier9319
    @jean-francoiscarrier9319 2 роки тому

    Perfect video again! I will have to watch the others too! Thanks!!

  • @paxhaven5
    @paxhaven5 3 роки тому +1

    Good information, Matt! Much appreciated.

  • @kimberlyholland9280
    @kimberlyholland9280 3 роки тому +1

    Yes, I agree with Daniel Jeffrey, you have a talent for teaching. THANK YOU!! & don't change! In past life, I was an OO ABAP developer (yes it is object-oriented..yeah..i know). You are the equivalent of Thomas Jung @SAP! I hope SF scoops you up, if they haven't already!

  • @ManiMahal-pn4ip
    @ManiMahal-pn4ip Рік тому

    Thanks Matt for this informative Tutorial. I would like to know if you have made any videos for inbound integrations into salesforce? Thank you.

  • @PuerinTheHunter
    @PuerinTheHunter 3 роки тому +1

    Nice video! Thanks for posting it!
    @36:30 you said string parsing is enormous overhead.
    What if I just use String fieldValue = response.getBody().substringBetween( '"fieldName":"', '',' ); to get a single field??
    Asssume I just need few fields from the JSON response, that would be a lot faster than using wrapper class and deserializing JSON, wouldn't it?

    • @CodingWithTheForce
      @CodingWithTheForce  3 роки тому +2

      If it's a simple JSON object and you're only getting one or two fields from it, that's ok to do. Much more than that though and you'll start to see the performance degradation start to add up.

  • @rahulsethi8914
    @rahulsethi8914 2 роки тому

    Wow man! You really helped me alot!

  • @GreeveCapricous
    @GreeveCapricous 2 роки тому

    Nice Class. Makes me feel a little less timid about approaching the integrations via Apex vs middleware

  • @MrBenjo000
    @MrBenjo000 Рік тому

    My json2apex output file looks different with the JSONParser method included in all methods, and each value includes the {get;set;}, some values include _Z, like "public Integer limit_Z {get;set;} // in json: limit" . This makes sense for my use case as I have system values in the json payload and would need a way to parse through this using JSONParser method. I'm wondering how do I initiate this JSONParser method when generating my wrapper class @CodingWithTheForce? Or if you were to include this in your example above how would you initiate that. I've included a sample of the wrapper class. Thanks very much, your videos have been super useful to develop my understanding of rest integration.
    public class JSON2Apex {
    public class Data {
    public String client_ref {get;set;}
    public Integer limit_Z {get;set;} // in json: limit
    public Data(JSONParser parser) {
    while (parser.nextToken() != System.JSONToken.END_OBJECT) {
    if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) {
    String text = parser.getText();
    if (parser.nextToken() != System.JSONToken.VALUE_NULL) {
    if (text == 'client_ref') {
    client_ref = parser.getText();
    } else if (text == 'limit') {
    limit_Z = parser.getIntegerValue();
    } else {
    System.debug(LoggingLevel.WARN, 'Data consuming unrecognized property: '+text);
    consumeObject(parser);
    }
    }
    }
    }
    }
    }

  • @walkswithcedarandmaddy6672
    @walkswithcedarandmaddy6672 3 роки тому +1

    could you possibly do a video explaining these wrapper classes in more detail? I'm having trouble figuring out how to access data that's nested in the wrapper class. it's silly but I'm practicing callouts by making a salesforce pokedex and getting the info from callouts to the pokeapi. I was able to get all the names of the pokemon by using this video. but when I go to the pokemon's individual page there are nested json objects and arrays.
    I think it would be really helpful if you did a couple of different callouts with nested and varied data. I'm fairly new to apex. parsing json is so much easier in javascript and python, lol.

  • @parvezalam204
    @parvezalam204 Рік тому

    Thank you for it

  • @TK-vt3ep
    @TK-vt3ep 2 роки тому

    How to parse html with img from json you have and insert into salesforce object??? Could you please suggest.

  • @shaswat6297
    @shaswat6297 2 роки тому

    3:30 point of this vdo
    4:30 postman or use han
    6:55 json etto apex class Han direct

  • @mailme7514
    @mailme7514 2 роки тому

    Hello could you please do few more sessions on same wrapper class integration topic which is also known as Data transfer object it would be very much helpful.

  • @pavandkbose
    @pavandkbose 3 роки тому

    Hi ,could you please make a detailed video on Test Class on every aspect??

    • @CodingWithTheForce
      @CodingWithTheForce  3 роки тому

      Hey Pavan, yes! It will be a little while but as part of the Intro to Apex tutorial series I'm currently creating I will be creating some videos going over absolutely everything related to test classes! You can follow the playlist here: ua-cam.com/play/PL0wESsiWMBTrCT3kNGIT3HpWLG6SmVr2F.html

    • @pavandkbose
      @pavandkbose 3 роки тому

      @@CodingWithTheForce Sure thanks a lot as I'm from Non- coding background ,I'm finding it difficult to analyse the problem and impliment the right solution..and your videos help me a lot in figuring out the issues..
      Hope one day I also become a software developer as you are🙂

  • @romanregmi1332
    @romanregmi1332 Рік тому

    You should have picked a more difficult JSON data.