Apex Triggers - 37 (Trigger Interview Scenario)
Вставка
- Опубліковано 16 лип 2023
- 💻 Join the Titan Community : Discover Exclusive Insights on LinkedIn / mycompany
💻 Explore the Power of Titan : Visit Our Official Website Now 🔗 titandxp.com/ - Наука та технологія
great way of excuting map, one shot two birds(oppotunity and contact)!!!!!
Very helpful scenerios
Glad you like them!
Thanks sir
Welcome
Is it possible to provide code of all triggers in one pdf document?
Yes amit bhai i have planned to do it after completion of series i mean aftee 50th scenario
Can you please try to provide without map. It's very difficult to use map. I saw all your previous videos. Try to use list set only. Or eleae make one video on MAP.... Please
Hey buddy using map is very useful it will always helps in the scenario like avoiding nested for loops. that’s why you should learn how we can use maps
@@sfdcninjas but iam not understanding map exactly. Can you make one video on MAP. How it's work, how to use, how to implinent. Please
I also feel same 😌
don’t worry i will explain use of map with a very simple example in next scenario don’t forget to watch it
Guys please check out this explanation if you still find issue while working with maps i will explain map in upcoming videos but as of now please try to understand working of maps.
In Apex programming, a Map collection is a way to store data in key-value pairs. Think of it like a dictionary where each entry has a unique key and a corresponding value. Here's a simple explanation with an example:
Let's say you want to keep track of students and their ages. With a Map, you can store the students' names as keys and their ages as values. Here's how you would do :
// Creating a Map to store student names and ages
Map studentAgesMap = new Map();
// Adding data to the Map
studentAgesMap.put('John', 18);
studentAgesMap.put('Emily', 20);
studentAgesMap.put('Michael', 17);
// Accessing values from the Map using keys
Integer johnAge = studentAgesMap.get('John'); // This will return 18
// Updating a value in the Map
studentAgesMap.put('Emily', 21); // Updating Emily's age to 21
// Removing an entry from the Map
studentAgesMap.remove('Michael'); // Removing Michael from the Map
// Checking if a key exists in the Map
Boolean hasEmily = studentAgesMap.containsKey('Emily'); // This will be true
// Getting all the keys and values from the Map
List names = studentAgesMap.keySet(); // Returns a list of names (John, Emily)
List ages = studentAgesMap.values(); // Returns a list of ages (18, 21)