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
10 months agoVerda
10 months agoNobuko
10 months agoCornell
11 months agoAndra
11 months agoJosphine
11 months agoLucina
11 months agoBilly
11 months agoArminda
11 months agoRolland
11 months agoElmer
11 months agoBelen
11 months agoFairy
11 months ago