• Jan Revet
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
I have this json string i am pulling in with the code below:

{"success":1,"statuscode":200,"data":[{"kleur1":"rood","kleur2":"wit","kleur3":"blauw"},{"kleur1":"rood","kleur2":"wit","kleur3":"blauw"},{"kleur1":"rood","kleur2":"wit","kleur3":"blauw"}]}

The code in Developer Console:

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://domain.ext/test');
request.setMethod('GET');
HttpResponse response = http.send(request);

if (response.getStatusCode() == 200) {
    
    Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
    List<Object> rows = (List<Object>) results.get('data'); 
    for (Object row : rows) {
        System.debug('TEST ' + row.kleur1);
    }

}

This code produces an error: Line: 13, Column: 36
Variable does not exist: kleur1. Houw should I access the field 'kleur1' of the object row?
I have a Lightning app with a visual force page that contains tabs. When the page loads my tabs look like this:

User-added image

Which is not what I want. Could anyone shed some light on this? May thanks in advance!
I have a custom object namend tpdDatabase. I have an Apex class with the method below to get an instance of this object (by databasename). 

The line "tpdDatabase__c tpDatabase = tpdDatabase__c.getValues(databaseName);" produces this error:

Not of type Custom Settings

I don't quite understand what goed wrong here. Could anyone point me in the right direction? Many thanks in advance!

    public tpdDatabase__c getByDatabaseName(String databaseName) {
        
        tpdDatabase__c tpDatabase = tpdDatabase__c.getValues(databaseName);
        if (tpDatabase == null) {
        return null;
        }
        return tpDatabase; 
    }
I have this json string i am pulling in with the code below:

{"success":1,"statuscode":200,"data":[{"kleur1":"rood","kleur2":"wit","kleur3":"blauw"},{"kleur1":"rood","kleur2":"wit","kleur3":"blauw"},{"kleur1":"rood","kleur2":"wit","kleur3":"blauw"}]}

The code in Developer Console:

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://domain.ext/test');
request.setMethod('GET');
HttpResponse response = http.send(request);

if (response.getStatusCode() == 200) {
    
    Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
    List<Object> rows = (List<Object>) results.get('data'); 
    for (Object row : rows) {
        System.debug('TEST ' + row.kleur1);
    }

}

This code produces an error: Line: 13, Column: 36
Variable does not exist: kleur1. Houw should I access the field 'kleur1' of the object row?
I have a Lightning app with a visual force page that contains tabs. When the page loads my tabs look like this:

User-added image

Which is not what I want. Could anyone shed some light on this? May thanks in advance!
I have a custom object namend tpdDatabase. I have an Apex class with the method below to get an instance of this object (by databasename). 

The line "tpdDatabase__c tpDatabase = tpdDatabase__c.getValues(databaseName);" produces this error:

Not of type Custom Settings

I don't quite understand what goed wrong here. Could anyone point me in the right direction? Many thanks in advance!

    public tpdDatabase__c getByDatabaseName(String databaseName) {
        
        tpdDatabase__c tpDatabase = tpdDatabase__c.getValues(databaseName);
        if (tpDatabase == null) {
        return null;
        }
        return tpDatabase; 
    }