For Online Individual or Group Training Please Email or Visit below Website. Email: sanjaygupta.techschool@gmail.com or Visit: studysalesforce.com/ Connect with Sanjay Gupta on Linkedin: www.linkedin.com/in/sanjay-gupta-bb2a79bb/ Udemy : Enroll Salesforce Flow Builder Masterclass: kadge.io/flowbuilder Udemy : Enroll Salesforce Admin Certification Masterclass : kadge.io/admin201 Udemy : Enroll Salesforce PD1 Certification Masterclass : kadge.io/pd1 Please like and subscribe to support the efforts.
Suggestion: Below code is much simpler to understand for beginners insert accList; boolean exceptionThrown=false; try { delete accList; } catch(exception e) { exceptionThrown=true; System.assert(e.getMessage().contains('Warning!: Active Account can\'t be deleted!'), 'Exception was not thrwon'); } Test.stopTest(); system.assertEquals(true, exceptionThrown);
For Online Individual or Group Training Please Email or Visit below Website.
Email: sanjaygupta.techschool@gmail.com or Visit: studysalesforce.com/
Connect with Sanjay Gupta on Linkedin: www.linkedin.com/in/sanjay-gupta-bb2a79bb/
Udemy : Enroll Salesforce Flow Builder Masterclass: kadge.io/flowbuilder
Udemy : Enroll Salesforce Admin Certification Masterclass : kadge.io/admin201
Udemy : Enroll Salesforce PD1 Certification Masterclass : kadge.io/pd1
Please like and subscribe to support the efforts.
thank you so much sir!
Keep watching
Sir plzz upload more videos on LWC
Tq
hi sir @sanjayGupta , why we should use trigger.old?
still i cannot understand!
@@mchan9424 beacuse you are deleting record which is old
use false in last assertion method
Suggestion: Below code is much simpler to understand for beginners
insert accList;
boolean exceptionThrown=false;
try
{
delete accList;
}
catch(exception e)
{
exceptionThrown=true;
System.assert(e.getMessage().contains('Warning!: Active Account can\'t be deleted!'), 'Exception was not thrwon');
}
Test.stopTest();
system.assertEquals(true, exceptionThrown);