Question: 1
A developer uses an 'after update' trigger on the Account object to update all the Contacts related to the Account. The trigger code shown below is randomly failing.
List<Contacts> theContacts = new List<Contacts>(); for(Account a : Trigger.new){
for(Contact c : [SELECT Id, Account_Date__c FROM
Contact WHERE AccountId = :a.Id]){ c.Account_Date__c = Date.today(); theContacts.add(c);
}
} updates theContacts;
Which line of code is causing the code block to fail?
Question: 2
What are two valid options for iterating through each Account in the collection List <Account> named AccountList? Choose 2 answers.
Question: 3
A developer executes the following code in the Developer Console:
List<Account> fList = new List <Account> ();For(integer i= 1; I <= 200; i++){fList.add(new Account ( Name = 'Universal Account ' + i));}Insert fList;List <Account> sList = new List<Account>();For (integer I = 201; I <=
20000; i ++){sList.add(new Account (Name = 'Universal Account ' + i));}Insert sList;How many accounts are created in the Salesforce organization ?
Question: 4
Given:
Map<ID, Account> accountMap = new Map>ID, Account> ([SELECT Id, Name FROM Account]);
What are three valid Apex loop structures for iterating through items in the collection? (Choose three.)
Question: 5
A developer runs the following anonymous code block:List<Account> acc = [SELECT Id FROM Account LIMIT 10];Delete acc;Database.emptyRecycleBin(acc);system.debug(Limits.getDMLStatements()+ ', '
+Limits.getLimitDMLStatements());What is the result?