All About Trigger Handler & Helper in

  Рет қаралды 27,220

SFDC Panther+

SFDC Panther+

Күн бұрын

Пікірлер: 23
@NirbhayKachhwaya
@NirbhayKachhwaya 5 жыл бұрын
Hi Amit, I learn so many things from you. Thanks man. And the video is just awesome
@sfdcpanther
@sfdcpanther 5 жыл бұрын
Thanks man
@tomleehobbs
@tomleehobbs Ай бұрын
If you attempt the deletion via the execution of the Salesforce API and the database returns an error due to a restriction, your can catch this exception and customize the message before displaying it to the user, or for recurring issues, consider adding a notification or suggestion within the application that advises users of the restriction on accounts with closed-won opportunities.
@shekharnartam3444
@shekharnartam3444 3 жыл бұрын
Thank @ Amit , Excellent work once again !!!! I request you to please make some more use case videos on the trigger, trigger handler, and helper class, and test class for the same example.
@mrinalkishore4424
@mrinalkishore4424 5 жыл бұрын
Your videos are good and very helpful. Im surprised they have so less views
@JaimeBIDtravel
@JaimeBIDtravel 3 жыл бұрын
Very clear explanation. What about if logic is a bit more complex and many steps are needed. Would that mean many methods within the same class? How to concatenate them?
@sfdcpanther
@sfdcpanther 3 жыл бұрын
If it's a bit complex then there might be many methods based on the requirement.
@SarGuP
@SarGuP 4 жыл бұрын
Can we use oldmap in the first for loop to throw the error so we don't need second trigger
@kathirvel8711
@kathirvel8711 4 жыл бұрын
Thanks buddy
@ANKITASINGH-vx8jz
@ANKITASINGH-vx8jz 3 жыл бұрын
Hi Amit, Can you please provide me some trigger assignments as I want to improve my apex?
@sfdcpanther
@sfdcpanther 3 жыл бұрын
Please visit sfdcpanther.com and you will get the link for the same
@harmeetsingh4771
@harmeetsingh4771 3 жыл бұрын
You explain very well Amit, can you please help in getting a job.
@sfdcpanther
@sfdcpanther 3 жыл бұрын
No one can help you in getting the job but I can guide you that's what I can do
@harmeetsingh4771
@harmeetsingh4771 3 жыл бұрын
Ok sure Amit. Please guide me. Tell me what should I do.
@sfdcpanther
@sfdcpanther 3 жыл бұрын
📢📢 Hi Everyone, I have prepared a document which have the complete step by step path to follow for any salesforce admin or development. ⚡⚡Link to salesforce admin and development path 📌quip.com/ubNmAMnGbFGO This document also includes the live project 📌Link to live project ⚡quip.com/7MD7Al2cxdQA For more join 📌 telegram.dog/sfdcpanther
@harmeetsingh4771
@harmeetsingh4771 3 жыл бұрын
@@sfdcpanther Thanks brother for the help
@vamsikrishna3970
@vamsikrishna3970 5 жыл бұрын
Hi, the video is very good I have one generic problem statement can you solve and post. Problem statement: When an new contact created for account we need to uncheck checkbox isLatest of pervious contact record for that account and mark isLatest for newly creating contact as checked. Note: updating different records in same object. Can you please solve it... Thanks in advance
@DatarGrover-DG
@DatarGrover-DG 3 жыл бұрын
public class ContactTriggerHelper{ public static void beforeInsertContactHelperMethod(List sObjectIdList,Map sObjectNewMap){ List accountIdList = new List(); List contactList = new List(); Map accountToContactMap = new Map(); for(Contact contactIterator : sObjectIdList){ if(!accountIdList.contains(contactIterator.AccountId)){ accountIdList.add(contactIterator.AccountId); contactIterator.isLatest__c = true; accountToContactMap.put(contactIterator.AccountId,contactIterator); }else{ accountToContactMap.get(contactIterator.AccountId).isLatest__c = false; contactIterator.isLatest__c = true; accountToContactMap.put(contactIterator.AccountId,contactIterator); } } for(Contact contactIterator : [SELECT ID,isLatest__c FROM Contact WHERE AccountId IN : accountIdList]){ contactIterator.isLatest__c = false; contactList.add(contactIterator); } update contactList; } }
@ramkumarsivanath3858
@ramkumarsivanath3858 2 жыл бұрын
I can't see your video, it's full of blur
@sfdcpanther
@sfdcpanther 2 жыл бұрын
Change the Quality of the video
@vikramkasote1491
@vikramkasote1491 2 жыл бұрын
what if I do like this ? If(Trigger.isBefore && Trigger.isDelete) { List acclist=New List(); List accountwithopp=[Select Id,Name, (Select Id,Name,StageName from Opportunities where stageName='Closed Won') from Account]; for(Account acc:trigger.old) { for(Account acc1:accountwithopp){ if(acc.id==acc1.id) { acc.addError('You can not delete closed won opportunity'); } } } }
@sfdcpanther
@sfdcpanther 2 жыл бұрын
That's your choice. No one is stopping you. The purpose is to use Helper & handler classes because that is the best practice and easy to maintain and understand when you leave the company. Also, If you have bulk data your code will break for querying more than 50K rows.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 154 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 16 МЛН
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 45 МЛН
Salesforce Developer Tutorial - The Complete Guide To Apex Triggers in 2022
2:09:40
Overcome Salesforce Governor Limits Using Platform Events
1:32:18
Salesforce Apex Hours
Рет қаралды 41 М.
Trigger Framework in Salesforce
1:19:15
Salesforce Apex Hours
Рет қаралды 45 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 108 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 154 МЛН