Biswajeet is my Name, Success is my Aim and Challenge is my Game.
Risk & Riding is my Passion and Hard Work is my Occupation.
Love is my Friend, Perfection is my Habit and Smartness is my Style.
Smiling is my Hobby, Politeness is my Policy and Confidence is my Power.
trigger AccountTrigger on Account (before delete, before update, before insert, after insert, after update) {
if (trigger.isDelete) {
for (Account acc : trigger.old) {
acc.addError('You cannot delete account records');
}
}
}
Using .KeySet() on a map, we will get a list of all the keys returned.
Map<Id, Master_Obj__c> masterMap = new Map<Id, Master_Obj__c>([SELECT Id, Name FROM Master_Obj__c]);
List<Detail_Obj__c> objDetailList = [Select Id, Name FROM Detail_Obj__c WHERE Master_Obj__c IN :masterMap.KeySet()]