*_Link to document -_* www.pantherschools.com/how-to-prevent-duplicate-record-using-trigger/ Follow us on Social Media Channels - Telegram Channel - telegram.dog/sfdcpanther RUclips - www.youtube.com/@pantherschools LinkedIn - www.linkedin.com/in/cloudyamit/ Topmate - topmate.io/cloudyamit Instagram - instagram.com/cloudyamit/ Subscribe to our RUclips channel using the below link bit.ly/pantherschools Join our telegram channel bit.ly/sfdcpanther
Have a quick question on the soql query I’m not sure how we are adding a filter with list of new records. As these records are not yet committed to sf so how can we get the id from those records ? Can you give some insight on this please @pantherschool time stamp 19:28 min
@PantherSchool how can we know that we need to type cast the values when we are passing Trigger.oldMap? also in the dispatcher System.TriggerOperation?
Bhaiya, 28:31 pe joh bhi aapko name aur rating mile the, uspe query karke agar account list ka size >0 hojata toh pata chal jata duplicate hai ya nahi lekin aap last me dubara 2 for loop kyu use kiye?
@@pantherschools in the first trigger prevent duplicate contact if we insert using collections then duplicates will be skipped. 36:18 At 43:34 you said u will explain later. Can u please tell where to find bulk handling
Sir location record is created but under location record account field is blank please tell me where I made mistake and if I use whatId then code is not running. public static void createLocationUnderAccount(List accountList) {
List locationList = new List();
for(Account acc : accountList) { // prepare a location record
for (Integer i = 0 ; i < acc.NumberofLocations__c ; i++ ) { Location__c loc = new Location__c(); loc.Name = 'created from account Trigger ' + acc.Name; loc.Account__c = acc.Id; loc.OwnerId = acc.OwnerId; locationList.add(loc); }
*_Link to document -_* www.pantherschools.com/how-to-prevent-duplicate-record-using-trigger/
Follow us on Social Media Channels -
Telegram Channel - telegram.dog/sfdcpanther
RUclips - www.youtube.com/@pantherschools
LinkedIn - www.linkedin.com/in/cloudyamit/
Topmate - topmate.io/cloudyamit
Instagram - instagram.com/cloudyamit/
Subscribe to our RUclips channel using the below link
bit.ly/pantherschools
Join our telegram channel
bit.ly/sfdcpanther
Thank you Sir. Even paid courses are not provided this type of knowledge🙏
Thank you Sachin. Keep learning
great initiative sir Hindi me padhane k liye
Thank You
Thank you Amit Bhai for beautiful explanation.
Thank You
Great content, very informative!
Thanks You
Nice work AMit bro
Thank you
Have a quick question on the soql query I’m not sure how we are adding a filter with list of new records. As these records are not yet committed to sf so how can we get the id from those records ? Can you give some insight on this please @pantherschool time stamp 19:28 min
The scenario we are talking about here in this timestamp is for update and in case of before update we will have the records id
Please make a video on the scenario of duplicate records in the new records while bulk load
We have already covered the same in the coming videos. Keep watching
@PantherSchool how can we know that we need to type cast the values when we are passing Trigger.oldMap? also in the dispatcher System.TriggerOperation?
Everytime you want to pass the Map from the Dispatcher class to the Handler class and those maps are part of the Trigger Context variable.
Thank you amit Bhai..but i have a doubt apex best practice says avoid SOQL inside for loop so why you use inside
Hello 👋,
You should have watched the complete video because I have made the query on purpose and then removedb
Bhaiya, 28:31 pe joh bhi aapko name aur rating mile the, uspe query karke agar account list ka size >0 hojata toh pata chal jata duplicate hai ya nahi
lekin aap last me dubara 2 for loop kyu use kiye?
inner loop will make sure ki hm add error sahi record pe kr rahe hai jiska duplicate hai na ki kisi bhi record me
@@pantherschools Got it Bhaiya! Aapka class sunke bahut maza aata hai aur seekhne ko bhi milta hai :D
How to handle first trigger in bulk scenario ?
I didn't get which triggere you are talking about. But we have talked about how to make them bulkified
@@pantherschools in the first trigger prevent duplicate contact if we insert using collections then duplicates will be skipped.
36:18
At 43:34 you said u will explain later. Can u please tell where to find bulk handling
@@rucha520 We have covered in the coming lectures. Please keep watching those.
Sir location record is created but under location record account field is blank
please tell me where I made mistake and if I use whatId then code is not running.
public static void createLocationUnderAccount(List accountList) {
List locationList = new List();
for(Account acc : accountList) {
// prepare a location record
for (Integer i = 0 ; i < acc.NumberofLocations__c ; i++ ) {
Location__c loc = new Location__c();
loc.Name = 'created from account Trigger ' + acc.Name;
loc.Account__c = acc.Id;
loc.OwnerId = acc.OwnerId;
locationList.add(loc);
}
}
insert locationList;
}
check the event of your apex trigger. it should be after insert
@@pantherschools Thanks sir now problem is solved and your playlist is very useful for understanding salesforce development.🙏🙏
List accList = [SELECT Id,Name,Rating FROM Account WHERE NAME =:acc.Name AND Rating=:acc.Rating AND ID !=:acc.Id];
Good 👍