You need to sign in to do that
Don't have an account?
suyogya jain 6
URGENT!!!!! Invalid conversion from runtime type List<ANY> to Map<String,ANY>
Map<String,Object> results = (Map<String,Object>)JSON.deserializeUntyped(response.getBody());
list<object> attchlist;
list<ContentVersion> CV = new list<ContentVersion>();
list<ContentDocumentLink> CDLink = new list<ContentDocumentLink>();
Set<Id> contentDocumentIds = new Set<Id>();
Set<FileData> fileFromSAP = new Set<FileData>();
for(Object mapa:results.values() ){
Map<String,Object> tempMap = (Map<String,Object>)mapa;
map<string,object> attc = (Map<String,Object>)tempMap.get('Attachment');
}
This exception is coming while running the code...someone please help
list<object> attchlist;
list<ContentVersion> CV = new list<ContentVersion>();
list<ContentDocumentLink> CDLink = new list<ContentDocumentLink>();
Set<Id> contentDocumentIds = new Set<Id>();
Set<FileData> fileFromSAP = new Set<FileData>();
for(Object mapa:results.values() ){
Map<String,Object> tempMap = (Map<String,Object>)mapa;
map<string,object> attc = (Map<String,Object>)tempMap.get('Attachment');
}
This exception is coming while running the code...someone please help
As per in your code you are converting in MAP, this may be a issue, here you need to check in JSON
you can follow below example:-
If this solution is usefull for you, Please mark as a Best Answer to help others.
Regards
Mukesh
Invalid conversion from runtime type List<ANY> to Map<String,ANY>
Http h = new Http();
HttpResponse res = h.send(req);
Map<String,Object> resBody = (Map<String, Object>)JSON.deserializeUntyped(res.getBody());
List<String> fieldAPINames = new List<String>(); List<String> headerList = new List<String>();
String fieldQuery = 'SELECT ';
for(Object col : (List<Object>)resBody.get('columns')){
Map<String, Object> colFieldMap = (Map<String, Object>)col;
if((Boolean)colFieldMap.get('hidden') == false){
headerList.add((String)colFieldMap.get('label'));
fieldAPINames.add((String)colFieldMap.get('fieldNameOrPath'));
if(fieldQuery == 'SELECT '){
fieldQuery += (String)colFieldMap.get('fieldNameOrPath');
}
else
{
fieldQuery += ','+(String)colFieldMap.get('fieldNameOrPath');
}
}
}
Any help is appreciated