Why did the test method fail in the sandbox and pass in the Developer Console?

A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test...

January 16, 2021 No Comments READ MORE +

What is the correct implementation?

An org tracks customer orders on an Order object and the items of an Order on the Line Item object. The Line Item object has a MasterDetail relationship to the order object. A developer has a requirement to calculate the order amount on an Order and the line amount on...

January 15, 2021 No Comments READ MORE +

What are three ways for a developer to execute tests in an org? Choose 3.

What are three ways for a developer to execute tests in an org? Choose 3.A . Bulk APIB . Tooling APIC . Setup MenuD . Salesforce DXE . Metadata APView AnswerAnswer: B,C,D Explanation: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_testing.htm https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apextestsuite.htm

January 15, 2021 No Comments READ MORE +

Which type of org is best suited for this scenario?

A team of many developers work in their own individual orgs that have the same configuration at the production org. Which type of org is best suited for this scenario?A . Developer SandboxB . Developer EditionC . Full SandboxD . Partner Developer EditionView AnswerAnswer: B

January 15, 2021 No Comments READ MORE +

Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?

Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?A . List <sObject> searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead);B . List<List <sObject>> searchList = (FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead);C . Map <sObject> searchList = (FIND "*ACME*"...

January 15, 2021 No Comments READ MORE +

Which approach can efficiently generate the required data for each unit test?

A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of test allowing them to test independent requirements various types of Salesforce Cases. Which approach can efficiently generate the required data for each unit test?A . Use @TestSetup with a viod method.B...

January 15, 2021 No Comments READ MORE +

What is the practice to get the sum of all order line totals on the order header?

Universal Container use a simple order Management app. On the Order Lines, the order line total is calculated by multiplying the item price with the quantity ordered. There is a Master-Detail relationship between the Order and the Order Lines object. What is the practice to get the sum of all...

January 14, 2021 No Comments READ MORE +

In which two ways can the developer declare the variables to ensure their value can only be assigned one time?

A developer is implementing an Apex class for a financial system. Within the class, the variables ‘creditAmount’ and ‘debtAmount’ should not be able to change once a value is assigned. In which two ways can the developer declare the variables to ensure their value can only be assigned one time?...

January 14, 2021 No Comments READ MORE +

Which two statements enable the developer to save the records to the database without an Id?

A developer needs to save a List of existing Account records named myAccounts to the database, but the records do not contain Salesforce Id values. Only the value of a custom text field configured as an External ID with an API name of Foreign_Key__c is known. Which two statements enable...

January 14, 2021 No Comments READ MORE +

What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3 answers

What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3 answersA . A method using the @InvocableMethod annotation must define a return value.B . A method using the @InvocableMethod annotation can have multiple input parameters.C . A method using the @InvocableMethod annotation must be declared as staticD...

January 14, 2021 No Comments READ MORE +