Salesforce
PDII · Question #414
A developer is asked to update data in an org based on new business rules. The new rules state that Accounts with the type set to 'Customer' should have a status of 'Active', and Accounts with the…
The correct answer is B. Map<String, String> statusMap = new Map<String, String>{'Customer'=>'Active'. See the full explanation below for the reasoning.
Question
A developer is asked to update data in an org based on new business rules. The new rules state that Accounts with the type set to 'Customer' should have a status of 'Active', and Accounts with the type set to 'Prospect' should have a status of 'Pending'. No other changes to data should be made. Which code block will accurately meet the business requirements?
Options
- AMap<String, String> statusMap = new Map<String, String>{'Customer'=>'Active',
- BMap<String, String> statusMap = new Map<String, String>{'Customer'=>'Active',
- CList<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM
- DList<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM
How the community answered
(41 responses)- A5% (2)
- B80% (33)
- C12% (5)
- D2% (1)
Community Discussion
No community discussion yet for this question.