List, Set and Map in Salesforce.

Introduction to List:-

List is nothing but it is a class available in salesforce and have the below method.

  • List are first and Most Important Data Type.
  • Why because every SOQL return the List and we can only do the DML on List Collection Type
  • List are Order set of Collection
  • Can Contains Duplicate.
Method of List:-
  1. Add()
  2. Add (Index, element)
  3. AddAll()
  4. Clear()
  5. Clone()
  6. Contains()
  7. Equals()
  8. Get()
  9. isEmpty()
  10. Remove()
  11. Set()
  12. Sort()
What is Set?:-
  • Set is an unorder collection of Element
  • Can not contains duplicate element like list.
  • Can not be used to store the SOQL Result
Method of Set:-
  • Add()
  • Contains()
  • Size()
  • Clear()
  • addAll()
Introduction to MAP:-

Map is a collection of key value pair where key will be unique and value can be duplicate.

  • Map => Key, Value
  • Unique Key
  • Unorder set of collection
  • Use Map when you have multiple value related to single key. For example, Account Id as a Key and List of Contacts as a Value.
  • To Avoid SOQL inside For Loop
Method of Map:-
  • Put()
  • containsKey()
  • Keyset()
  • Values()
  • Clear()
  • Size()
  • get()


To know more live demo source code in Salesforce lightning, Trigger, Visualforce & LWC, Use this link..



List, Set and Map in Salesforce. List, Set and Map in Salesforce. Reviewed by Admin on 12:05 AM Rating: 5

4 comments:

  1. your article is awesome.
    Great Thanks for sharing awesome info. I have a information about fake ID card. Idsbuddy is 𝐛𝐞𝐬𝐭 𝐟𝐚𝐤𝐞 𝐢𝐝 𝐦𝐚𝐤𝐞𝐫 𝐰𝐞𝐛𝐬𝐢𝐭𝐞𝐬. You can learn more information about fake id card from this website.
    you can check best fake id websites

    ReplyDelete

header banner -- www.w3web.net



Powered by Blogger.