Salesforce DEX-450 Exam - Topic 7 Question 7 Discussion
Given the following block code: try{ List retrievedRecords = [SELECT Id FROM Account WHERE Website = null]; }catch(Exception e){ //manage exception logic } What should a developer do to ensure the code execution is disrupted if the retrievedRecordslist remains empty after the SOQL query?
B) Check the state of the retrievedRecords variable and use System.assert(false) if the variable is empty
A) Check the state of the retrieveRecords variable and throw a custom exception if the variable is empty.
C) Check the state of the retrievedRecords variable and access the first element of the list if the variable is empty.
D) Replace the retrievedRecords variable declaration from a List of Account to a single Account.
Magda
7 months agoVerda
7 months agoNobuko
7 months agoCornell
8 months agoAndra
8 months agoJosphine
8 months agoLucina
8 months agoBilly
8 months agoArminda
8 months agoRolland
8 months agoElmer
8 months agoBelen
8 months agoFairy
8 months ago