How do you relate contact to account when sending an email. Line number 28 - You fetch all the contacts of account modified between the 2 dates,(curretnt - lastmodified). What if you have 3 account a1,a2,a3 and each has 1-1 contact under each account. Now,you have 3 owners. It will fail, since you have to create a map of accountId to emailbody. And use this map at last when sending the email.
Great video thank u I’m just a little bit confused What if we bulk update accounts and contacts with different owners than shouldn’t owner of each acc receive only contact info that related to them? Shouldn’t we need also separate email bodies by acc id ?
tip to all the viewers- This youtuber is doing a noble job here. But pls write the triggers by yourself without seeing his solution. A lot of his solutions are slightly incorrect and would fail in bulk scenarios like this one.
Hi Romit, Thanks for the feedback. These videos are intended for interview preparation, where time is often limited. Additionally, all of these scenarios can be handled using flows. However, I always strive to avoid bad practices, such as performing DML operations or soql inside a for loop. Let me know if there’s anything more you want to add or adjust!