Here is the code that where we insert Slot objects.
Thanks,Alper OzdamarSenior Software Engineer//validSlots has only 67 records. But takes 7500 ms
if(validSlots != null && validSlots.size() > 0) {
insert validSlots;
}
8 answers

Hi Alper, I have gone through your code then I realized there is no need to check null condition because you already check size() > 0.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.Thanks and Regards,Deepali Kulshresthawww.kdeepali.comCheck below code
if(validSlots.size() > 0) {
insert validSlots;
}