2016-05-12 8 views
0

Ich versuche, Karte zu debuggen und ich möchte alle Daten in der Karte zu sehen. Wenn ich die Karte mit System.debug() drucke, wird nur das erste Element in den Protokollen angezeigt und nach dem ersten Element gibt es eine Nachricht, die besagt already output.Bereits Ausgabe Problem mit Karte in Apex

Gibt es eine Problemumgehung zum Anzeigen von Daten in Map mit der Funktion System.debug()?

Antwort

2

Sie können es tun, indem alle Werte in der Karte

Iterieren
Map<String, String> mapToPrint = new Map<String, String>(); 

mapToPrint.put('key1', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key2', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key3', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key4', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key5', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key6', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key7', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key8', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key9', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key10', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
mapToPrint.put('key11', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry'); 
Boolean contains = mapToPrint.containsKey('Blue'); 
System.assertEquals(true, contains); 

for (String key: mapToPrint.keySet()) { 
    System.debug(LoggingLevel.DEBUG, 'key: ' + key + ' --> value: ' + mapToPrint.get(key)); 
} 

enter image description here

1

Bereits Ausgabe wird angezeigt, wenn der Wert, der die gleiche wie vorherige ist angezeigt muss.