• umonub htztqgmc
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 0
    Replies

Hi All, I'm looking for some advice on best practice. I want to loop through Options and I've come up with the following solution which actually works. What I want to know is whether or not my method of a loop within a loop is best practice or if there is a better way?

String json = '{'+
    '  \"TrackingCategories\": ['+
    '    {'+
    '      \"Name\": \"Region\",'+
    '      \"Status\": \"ACTIVE\",'+
    '      \"TrackingCategoryID\": \"351953c4-8127-4009-88c3-f9cd8c9cbe9f\",'+
    '      \"Options\": ['+
    '        {'+
    '          \"TrackingOptionID\": \"ce205173-7387-4651-9726-2cf4c5405ba2\",'+
    '          \"Name\": \"Eastside\",'+
    '          \"Status\": \"ACTIVE\"'+
    '        },'+
    '        {'+
    '          \"TrackingOptionID\": \"6eb12fdf-63de-4033-98df-be679d84e3c2\",'+
    '          \"Name\": \"North\",'+
    '          \"Status\": \"ACTIVE\"'+
    '        },'+
    '        {'+
    '          \"TrackingOptionID\": \"6159bdd4-b634-4338-a664-e929aa73f70f\",'+
    '          \"Name\": \"South\",'+
    '          \"Status\": \"ACTIVE\"'+
    '        },'+
    '        {'+
    '          \"TrackingOptionID\": \"161ad543-97ab-4436-8213-e0d794b1ea90\",'+
    '          \"Name\": \"West Coast\",'+
    '          \"Status\": \"ACTIVE\"'+
    '        }'+
    '      ]'+
    '    }'+
    '  ]'+
    '}';
TrackingOptionsResponse obj = TrackingOptionsResponse.parse(json);
System.debug('obj='+obj);



for(TrackingOptionsResponse.TrackingCategories r :obj.TrackingCategories){
    system.debug('r='+r.Name);
    System.debug('r2='+r.Options);
    for(TrackingOptionsResponse.Options l :r.options){
        System.debug('l='+l.Name);
    }
}

Thanks,

Dan

Hi,
I am trying to download files which range from 200 MB to 2 GB
I am making a HTTP GET Callout to an endpoint in Salesforce Apex Class

In postman, when I make the HTTP GET callout, a file stream gets started and the file download starts and I receive the "206 Partial content" message, the file starts getting downloaded in bits
After 40-50 secs, a window is popped-up on my screen asking to save the file and the file is saved on the System

WHen I try the same via HTTP GET Callout in Salesforce Apex Class, I receive the below Error:
Exceeded max size limit of 6000000

I understand that since the file size is large, it is exceeding the governor limits
SO, I tried to make a future callout by using the @future(callout=true) annotation
The Apex class is making a future callout, but I cant see any file downloaded

Does anyone have any idea how to handle file streaming in Salesforce APex?