function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KaityKaity 

'Map' usage concept

Hi,

 

We usually use map in triggers and classes. Can someone help me to understand in which object we should use map?

 

Suppose: I have 2 objects:

 object1

object2

Based upon crtain condition of objecct1, the certain field of object2 changes.

So,  in which object should we use map?

 

Please help.

Sonali BhardwajSonali Bhardwaj

Map is a kind of collection. You can only use map in Apex code only.

Yoganand GadekarYoganand Gadekar

Map is used to store your data.. it is one of the collections salesforce provides... it helps you hold data temperorily (in apex code) that helps build your logic.

Map has two components key and value..

map<key,value>

it helps you store data with relationships...

It will be good to understand LIst and Set (List and set are other collections used in salesforce) and then visit this page to know more about maps..

http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_collections_maps.htm

 

All about collections (List,set and Map) here

http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_collections.htm