You need to sign in to do that
Don't have an account?
vanillasky1.3938481563139287E12
Replace a value in map
I am collecting LOVs from a picklist in a map.
If value==ABCD, replace it with BCDE
Please help with the replace syntax
If value==ABCD, replace it with BCDE
Please help with the replace syntax
http://www.salesforce.com/us/developer/docs/dbcom_apex250/Content/apex_methods_system_map.htm
(for demo you could replace "SObj" with string.)
map<string,Sobj> mapRecords = new map<string,Sobj>();
mapRecords.put('1234',SObj);
mapRecords.put('5432',SObj);
mapRecords.put('ABCD',Sobj);
if (mapRecords.containsKey('ABCD')) {
SObj mySobj = mapRecords.Remove('ABCD'); // value is returned before its removed
mapRecords.put('BCDE',mySobj');
}