How can the developer generate the code coverage?
An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate the code coverage?A . Verify the user has permissions passing a user into System.runAs().B . Call the Apex class method from a testMethod instead of...
Which two changes should a developer make in this trigger to adhere to best practices?
Consider the above trigger intended to assign the Account to the manager of the Account’s region. trigger AssignOwnerByRegion on Account ( before insert, before update ) { List<Account> accountList = new List<Account>(); for( Account anAccount : trigger.new ) { Region__c theRegion = [ SELECT Id, Name, Region_Manager__c FROM Region__c WHERE...
What will happen when the mass update occurs?
An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Account’s address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign...
What should the developer do to ensure a more meaningful message?
A user receives the generic "An internal server error has occurred" while interacting with a custom Lightning Component. What should the developer do to ensure a more meaningful message?A . Add an onerror event handler to the tag.B . Add an error-view component to the markup.C . Use an AuraHandledException...
Which scenario necessitates that the callout be made in an @future method?
A developer is writing code that requires making callouts to an external web service. Which scenario necessitates that the callout be made in an @future method?A . The callouts will be made in an Apex Trigger.B . The callouts will be made in an Apex Test class.C . The callout...
What is the optimal method for a developer to troubleshoot this?
An Apex trigger creates an Order__c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders. What is the optimal method for a developer to troubleshoot this?A . Set up debug logging for every Sales Rep, then monitor the logs for errors...
Which code snippet will assert that the remote action returned the correct Account?
Consider the Apex class above that defines a RemoteAction used on a Visualforce search page. global with sharing class MyRemoter { public String accountName { get; set; } public static Account account { get; set; } public AccountRemoter() {} @RemoteAction global static Account getAccount(String accountName) { account = [SELECT Id,...
Which use case can only be performed by using asynchronous Apex?
Which use case can only be performed by using asynchronous Apex?A . Scheduling a batch process to complete in the futureB . Processing high volumes of recordsC . Updating a record after the completion of an insertD . Calling a web service from an Apex triggerView AnswerAnswer: D
What is the optimal way to implement this?
A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order__c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST...
What is the optimal way to accomplish this?
A developer is asked to build a solution that will automatically send an email to the Customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all Workflow Rules have fired. What is...