function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Map<String, String> colorCodes = new Map<String, String>(); colorCodes.put('Red', 'FF0000'); colorCodes.put('Blue', '0000A0'); String myColor = colorCodes.remove('Blue'); String code2 = colorCodes.get('Blue'); System.assertEquals(null, code2);
Hi @Sales Person 416,
Map contains values as per keys . So every key can be removed so that its related value would also be deleted . In your case you should use remove method of maps.
The sample code snippet below showcases how to remove an element from a Map within Apex.
Refer to the following documentation link to understand further. - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_map.htm
Hope this helps.
Please do not forget to mark this thread as SOLVED and the answer as the BEST ANSWER if it helps you resolve your issue.
Hi @Sales Person 416,
Map contains values as per keys . So every key can be removed so that its related value would also be deleted . In your case you should use remove method of maps.