You need to sign in to do that
Don't have an account?
Sumesh Chandran
I am trying to put the id from database.saveresult return values and then the matching value from the citylist list into this map below, but I get an error "Method does not exist or incorrect signature: void put(sumchans__City_Master__c, Id) from the type Map<String,String>"
Map put method not working
I am trying to put the id from database.saveresult return values and then the matching value from the citylist list into this map below, but I get an error "Method does not exist or incorrect signature: void put(sumchans__City_Master__c, Id) from the type Map<String,String>"
Database.SaveResult[] saveCityMaster = Database.Insert(cityList, false); Map<String,String> findCityId = new Map<String,String>(); for (Database.SaveResult sr : saveCityMaster) { if (!sr.isSuccess()) { findCityId.put(cityList.get(0),sr.getId()); } }
I hope it helps!
All Answers
You need to use Map<String, Id> because you are trying to place Id as the value in the map. Try this one
Regards,
Naga
I hope it helps!