PD 2 Flashcards
The Contact object has a custom field called “Zone.” Its data type is “Text” and field length is 3.
What is the outcome after executing the following code snippet in the org?
List<Contact> contactsToBeInserted=new List<Contact>(); Contact contactInstance= new Contact(LastName='Smith',
Department='Tech', Zone_c='IAD'); contactsToBeInserted.add(contactInstance); contactInstance= new Contact
(LastName='Sm1th', Department='Tech', Zone_c='PITT'); contactsToBeInserted.add(contactInstance); Database.insert
(contactsToBeInserted,true);
A. Both inserts succeed and the contact record that has the Zone value of 'PI'I'I' is set to NULL
B. A partial insert succeeds and the contact record that has the Zone value 'IAD' is inserted
C. Both inserts succeed and the contact record that has the Zone value of 'PITT' is truncated
D. An unhandled DML exception is thrown and no contact records are inserted</Contact></Contact>
D. An unhandled DML exception is thrown and no contact records are inserted
ABC Company has an Apex process that makes multiple extensive database operation and web service callouts. The database processes and web services can take a length time to run and must be run sequentially.
How should the developer write this Apex code without running into governor limits and system limitations?
Use Limits class to stop entire process once governor limits are reached.
Use multiple @future methods for each process and callout.
Use Queueable Apex to chain the jobs to run sequentially.
Use Apex Scheduler to scheduled each process.
Use Limits class to stop entire process once governor limits are reached.
A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order’s shipping address is not numeric.
What is a recommended way for the error message be displayed to the end user?
A. Use the apex:message tag to display errors
B. Use the aura:component tag to display errors
C. Use the ui:outputText tag to display errors
D. Use the ui:inputDefaultError tag to display errors
D. Use the ui:inputDefaultError tag to display errors
As part of point-to-point integration, a developer must call an external web service which, due
to high demand, takes a long time to provide a response. As part of the request, the developer must
collect key inputs from the end user before making the callout.
Which two elements should the developer use to implement these business requirements?
Choose 2 answers
A. Screen now
B. Process Builder
C. Lightning web component
D. Apex method that returns a Continuation object
C. Lightning web component
D. Apex method that returns a Continuation object
What are the ways a developer can create test data of Contacts? (Choose two.)
A. myDataFactory.createContacts(10)
B. Test.createTestData ()
C. Test.loadTestRecords(Contact.sObjectType, ‘staticResource’)
D. Test.loadData(Contact.sObjectType, ‘staticResource’)
A. myDataFactory.createContacts(10)
D. Test.loadData(Contact.sObjectType, ‘staticResource’)
A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on
the Opportunity’s Account whenever an Opportunity is dosed. In the test class for the trigger, the
assertion to validate the Last Sold Date field fails.
What might be causing the failed assertion?
A. The test class has not implemented seeAIIData-truwh the test method.
B. The test class has not re-queried the Account record after updating the Opportunity.
C. The test class has not defined an Account owner when inserting the test data.
D. The test class is not using System.runAs() to run tests as a Salesforce administrator.
B. The test class has not re-queried the Account record after updating the Opportunity.
A developer is building a Visualforce page that interacts with external services.
Which interface should the developer implement to test this functionality? (Choose two.)
A. HTTPCalloutMock
B. HTTPRequestMock
C. StaticResourceCalloutMock
D. HTTPResponseMock
A. HTTPCalloutMock
C. StaticResourceCalloutMock
Which annotation exposes an Apex class as a RESTful web service?
A . RemoteAction.
B . HttpInvocable.
C . AuraEnabled.
D . RestResource.
D . RestResource.
A developer created three Rollup Summary fields:
Total_timesheets_c, Total_Approved_timesheet_c and
Total_project_Timesheet_c in the custom object, project _c Now, the developer is tasked with created a new field to show the ratio between rejected and approved. what is two benefits using formula field instead of apex trigger
1.No test methods will be executed during deployment.
2.A test class that validates the formula field is needed for deployment.
3.Using a formula field reduces maintenance overhead.
4.A formula field will calculate the value retroactively for existing records
3.Using a formula field reduces maintenance overhead.
4.A formula field will calculate the value retroactively for existing records
An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance. When a test batch of records is loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created. What is the most extendable way to update the Apex Trigger to accomplish this?
A. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.
B. Add a Validation Rule to the Contract to prevent Contract creation by the user who loads the data.
C. Use a List Custom Setting to disable the trigger for the user who loads the data.
D. Add the Profile ID of the user who loads the data to the trigger so the trigger will not fire for this user.
A. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.
A developer is writing a complex application involving triggers, workflow rules, Apex classes, and processes. The developer needs to carefully consider the order of execution when developing the application.
1. Before Triggers
2. After Triggers
3. Post commit logic such as sending email
4. DML committed to the database
5. Workflow rules
6. Roll-up summary calculations
In what order do the following operations execute?
A. 1, 2, 5, 6, 4, 3
B. 1, 5, 6, 2, 4, 3
C. 1, 2, 4, 5, 6, 3
D. 1, 6, 5, 2, 4, 3
A. 1, 2, 5, 6, 4, 3
A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses.
Which tool should the developer use?
A. Developer Console
B. Force.com Migration Tool
C. Workbench
D. Force.com IDE
C. Workbench
A developer encounters an error that states that the Apex heap size is exceeded. Which technique may reduce heap size?
A. Add the transient keyword to the variable definition
B. Move the variable definition inside the scope of the function
C. Use static variables instead of instance variables
D. Use SOQL for loops instead of standard SOQL queries
D. Use SOQL for loops instead of standard SOQL queries
Which interface needs to be implemented by a Lightning Component so that it may be
displayed in modal dialog by clicking a button on a Lightning Record page?
A. Lightning:editAction
B.Force:lightningQuickAction
C. Force:lightningEditAction
D. Fightning:quickAction
B.Force:lightningQuickAction
The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored.
Which options are valid? (Choose two.)
A. Use the Apex Jobs page in setup
B. Query the Queueable Apex record
C. Query the AsyncApexJob record
D. Use the Scheduled Jobs page in setup
A. Use the Apex Jobs page in setup
C. Query the AsyncApexJob record
A developer has been asked to create code that will meet the following requirements:
Receives input of: Map<Id, Project_c), List<Account>
Performs a potentially long-running callout to an outside web service
Provides a way to confirm that the process executed successfully
Which asynchronous feature should be used?
A. @future (callout=true)
B. Database.AllowCallouts interface
C. Schedulable interface
D. Queueable interface</Account>
D. Queueable interface
Which are relevant practices while analyzing the timeline of different types of transactions in the execution overview panel? (Choose two.)
A. Log lines in the execution log panel can be analyzed for details about specific events
B. The performance tree should be use to analyze events further starting from the one that take the least amount of time
C. The execution tree can be used with the execution log to filter and get specific information about events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant amount of time
A. Log lines in the execution log panel can be analyzed for details about specific events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant amount of time
A developer created the following test method:
The developer org has five accounts where the name starts with Test”. The developer executes this
test in the Developer Console.
After the test code runs, which statement is true?
A. The test will fail.
B. There will be five accounts where the name starts with Test”
C. There will be six accounts where the name starts with Test”.
D. There will be no accounts where the name starts with “Test”
B?
A Salesforce org has more than 50,000 contacts. A new business process requires a
calculation that aggregates data from all of these contact records. This calculation needs to run once
a day after business hours.
Which two steps should a developer take to accomplish this?
Choose 2 answers
A. Implement the Queuable Interface in the class that contains the aggregate calculation method.
B. Use the areadOnly annotation on the method that performs the aggregate calculation.
C. Implement the schedulable Interface In the class that contains the aggregate calculation method.
D. Use the @future annotation on the method that performs the aggregate calculation.
A. Implement the Queuable Interface in the class that contains the aggregate calculation method.
C. Implement the schedulable Interface In the class that contains the aggregate calculation method.
What is the transaction limit on the number of Apex jobs added to the queue?
A. 200
B. There is no limit
C. 50
D. 100
E. 150
C. 50
A company has reference data stored in multiple Custom Metadata records that represent
default information for certain.
When a Contact is inserted, the default information should be set on the Contact from the Custom
Metadata records .. Address information.
What is the optimal way to automate this?
A. Apex Trigger
B. Process Builder
C. Visual Flow
D. Workflow Rule
B. Process Builder?
If the “PageReference.setRedirect” Apex function is set to True, what type of request is
made?
A. Postback request
B. If PageReference points to the same controller and subset of extensions, postback request,
otherwise get request
C. Get request
C. Get request
A lead developer for a Salesforce organization needs to develop a page-centric application
that allows the user to interact with multiple objects related to a Contact The application needs to
implement a third-party JavaScript framework such as Angular, and must be made available in both
Classic and Lightning Experience.
Given these requirements, what is the recommended solution to develop the application?
A. Visualforce
B. Lightning Web Components
C. Aura Components
D. Lightning Experience Builder
A. Visualforce
A developer created an Opportunity trigger that updates the account rating when an
associated opportunity is considered high value. Current criteria for an opportunity to be considered
high value is an amount greater than or equal to SI,000,000. However, this criteria value can change
over time.
There is a new requirement to also display high value opportunities In a Lightning web component.Which two actions should the developer take to prevent the business logic that obtains the high
value opportunities from being repeated in more than one place?
Choose 2 answers
A. Leave the business logic code Inside the trigger for efficiency.
B. Create a helper class that fetches the high value opportunities.
C. Call the trigger from the Lightning web component.
D. Use custom metadata to hold the high value amount.
B. Create a helper class that fetches the high value opportunities.
D. Use custom metadata to hold the high value amount.
Users upload .csv files in an external system to create account and contact records in
Salesforce. Up to 200 records can be created at a time. The users need to wait for a response from
Salesforce in the external system, but the data does not need to synchronize between the two
systems.
Based on these requirements, which method should a developer use to create the records in
Salesforce?
A. REST API request using composite/tree/
B. REST API request using composite/vbatch/
C. Bulk API 2.0
D. Apex web services
C. Bulk API 2.0
Which use case is an appropriate fit for the @future asynchronous Apex method? (Choose two.)
A. A developer has jobs that need larger query results than regular transactions allow
B. A developer needs to segregate DML operations and bypass the mixed save DML error
C. A developer has long-running jobs with large data volumes that need to be performed in batches
D. A developer has long-running methods and needs to prevent delaying an Apex transaction
B. A developer needs to segregate DML operations and bypass the mixed save DML error
D. A developer has long-running methods and needs to prevent delaying an Apex transaction
There are user complaints about slow render times of a custom data table within a
visualforce page that loads thousands of Account records at once.
What can a developer do to help alleviate such issues?
A. Upload a third-party data table library as a static resource.
B. Use the transient keyword in the Apex code when querying the Account records.
C. Use the standard Account List controller and implement pagination.
D. Use JavaScript remoting to query the accounts.
B. Use the transient keyword in the Apex code when querying the Account records.
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity’s Account?
A. List <Contact> contactList = new List <Contact>(); for(Opportunity o : opportunityList){ Account a = [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id = :o.AccountId] contactList.addAll(a.Contacts); )
B. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for (Opportunity o : opportunityList){ contactIds.add(o.ContactId); } for(Contact c : [SELECT Id FROM Contact WHERE Id IN :contactIds]){ contactList.add(c); }
C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }
D. List <Contact> contactList = new List <Contact>(); for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId] ){ contactList.add(c); }</Contact></Contact></Id></Id></Contact></Contact></Id></Id></Contact></Contact></Contact></Contact>
C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }</Id></Id></Contact></Contact>
What is the correct syntax for calling a controller action from a Visualforce page and updating part of the page once the action is completed? (Choose two.)
A. <apex:commandFunction></apex:commandFunction>
B. <apex:actionFunction></apex:actionFunction>
C. <apex:commandButton></apex:commandButton>
D. <apex:actionSupport></apex:actionSupport>
B. <apex:actionFunction></apex:actionFunction>
D. <apex:actionSupport></apex:actionSupport>
A developer must create a custom pagination solution. While users navigate through pages, if the data is changed from elsewhere, users should still see the cached results first accessed.
How can the developer meet these requirements?
A. Use @Cache annotation
B. Use a StandardSetController
C. Use OFFSET in SOQL queries
D. Use OFFSET WITH CACHE in SOQL queries
B. Use a StandardSetController
A developer has written an After Update trigger on Account. A workflow rule and field update cause the trigger to repeatedly update the Account records.
How should the developer handle the recursive trigger?
A. Deactivate the trigger and move the logic into a Process or Flow
B. Deactivate the workflow rule to prevent the field update from executing
C. Use a static variable to prevent the trigger from executing more than once
D. Use a global variable to prevent the trigger from executing more than once
C. Use a static variable to prevent the trigger from executing more than once
A developer has created a Visualforce page that uses a third-party JavaScript framework. The
developer has decided to supply data to the JavaScript functions using JavaScript Remoting for Apex
Controllers.
What is the correct syntax to declare a remote method in Apex? (Choose two.)
A. @RemoteObject global static String getTableQ
B. @RemoteAction public static String getTable()
C. @RemoteAction global static String getTable()
D. @RemoteAction global String getTable()
B. @RemoteAction public static String getTable()
C. @RemoteAction global static String getTable()
An integration user makes a successful login() call via the SOAP API.
What can be used in the SOAP header to provide server authorization for subsequent API requests?
A. Security token
B. OAuth access token
C. Named Credentials
D. Session ID
D. Session ID
What is a consideration when testing batch Apex? (Choose two.)
A. Test methods must execute the batch with a scope size of less than 200 records
B. Test methods must call the batch execute() method once
C. Test methods must use the @isTest (SeeAllData=true) annotation
D. Test methods must run the batch between Test.startTest() and Test.stopTest()
A. Test methods must execute the batch with a scope size of less than 200 records
D. Test methods must run the batch between Test.startTest() and Test.stopTest()
https://www.freecram.net/question/Salesforce.PDII.v2020-06-24.q45/what-can-be-done-to-improve-the-performance-of-the-insert-trigger-shown-above
A custom object called Credit_Memo_c exist in a Salesforce environment. As part of a new feature
development that retrieves and manipulates this type of record, the developer needs to ensure race
conditions are prevented when a set of records are modified within an Apex transaction.
In the preceding Apex code, how can the developer alter the query statement to use SOQL features
to prevent race condition within a transaction?
Memo Query end with for update
A Visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?
A. Use Javascript to move data processing to the browser instead of the controller.
B. Use the transient keywords for the List variables used in the custom controller.
C. Use lazy loading to load the data on demand, instead of the controller’s constructor.
D. Use an in the page to load all of the data asynchronously.
C. Use lazy loading to load the data on demand, instead of the controller’s constructor.
Universal Containers wants to use a Customer Community with Customer Community Plus licenses so their customers can track how many containers they are renting and when they are due back. Many of their customers are global companies with complex Account hierarchies, representing various departments within the same organization. One of the requirements is that certain community users within the same Account hierarchy be able to see several departments’ containers, based on a junction object that relates the Contact to the various Account records that represent the departments. Which solution solves these requirements?
A. A Visualforce page that uses a Custom Controller that specifies without sharing to expose the records
B. A Custom List View on the junction object with filters that will show the proper records based on owner
C. A Custom Report Type and a report Lightning Component on the Community Home Page
D. An Apex Trigger that creates Apex Managed Sharing records based on the junction object’s relationships
C. A Custom Report Type and a report Lightning Component on the Community Home Page
Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and billing addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth.
What would allow Universal Containers to switch vendors without updating the code to handle authentication?
A. Custom Metadata
B. Custom Setting (List)
C. Dynamic Endpoint
D. Named Credential
D. Named Credential
A company has a Lightning Page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data.
What can a developer use to analyze and diagnose the problem in the Lightning Page?
A. Salesforce Lightning Inspector Actions Tab
B. Salesforce Lightning Inspector Event Log Tab
C. Salesforce Lightning Inspector Transactions Tab
D. Salesforce Lightning Inspector Storage Tab
D. Salesforce Lightning Inspector Storage Tab
A company has code to update a Request and Request Lines and make a callout to their external ERP system’s REST endpoint with the updated records. The CalloutUtil.makeRestCallout fails with a ‘You have uncommitted work pending. Please commit or rollback before calling out’ error.
What should be done to address the problem?
A. Remove the Database.setSavepoint and Database.rollback.
B. Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
C. Change the CalloutUtil.makeRestCallout to an @future method.
D. Move the CalloutUtil.makeRestCallout method call below the catch block.
C. Change the CalloutUtil.makeRestCallout to an @future method
A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.
<apex:selectList>
<apex:selectOptions></apex:selectOptions>
</apex:selectList>
When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry.
What is the optimal way to implement this?
A. Add an <apex:actionFunction> within the <apex:selectOptions>.
B. Add an <apex:actionFunction> within the <apex:selectList>.
C. Add an <apex:actionSupport> within the <apex:selectList>.
D. Add an <apex:actionSupport> within the <apex:selectOptions>.</apex:selectOptions></apex:actionSupport></apex:selectList></apex:actionSupport></apex:selectList></apex:actionFunction></apex:selectOptions></apex:actionFunction>
C. Add an <apex:actionSupport> within the <apex:selectList></apex:selectList></apex:actionSupport>
The test method above calls a web service that updates an external system with Account information and sets the Account’s Integration_Updated__c checkbox to True when it completes. The test fails to execute and exits with an error: “Methods defined as TestMethod do not support Web service callouts. ”
What is the optimal way to fix this?
A. Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
B. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
C. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
D. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
B
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production.
What should the developer ensure to correct these errors?
A. Ensure queries do not exceed governor limits.
B. Ensure properties are marked as Transient.
C. Ensure properties are marked as private.
D. Ensure profiles have access to the Visualforce page.
B. Ensure properties are marked as Transient.
<lightning:layout multipleRows=”true”>
<lightning:layoutItem size=”12″>{!v.account.Name}
</lightning:layoutItem>
<lightning:layoutItem size=”12″>{!v.account.AccountNumber}
</lightning:layoutItem>
<lightning:layoutItem size=”12″>{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>
Refer to the component code above. The information displays as expected (in three rows) on a mobile device. However, the information is not displaying as desired (in a single row) on a desktop or tablet.
Which option has the correct component changes to display correctly on desktops and tablets?
A. <lightning:layout multipleRows=”true”>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″ largeDeviceSize=”4″>{!v.account.Name}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″ largeDeviceSize=”4″>{!v.account.AccountNumber}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″ largeDeviceSize=”4″>{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>
B. <lightning:layout multipleRows=”true”>
<lightning:layoutItem size=”12″ largeDeviceSize=”4″>{!v.account.Name}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ largeDeviceSize=”4″>{!v.account.AccountNumber}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ largeDeviceSize=”4″>{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>
C. <lightning:layout multipleRows=”true”>
<lightning:layoutItem size=”12″ mediumDeviceSize=”4″>{!v.account.Name}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”4″>{!v.account.AccountNumber}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”4″>{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>
D. <lightning:layout multipleRows=”true”>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″>{!v.account.Name}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″>{!v.account.AccountNumber}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″>{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>
D. <lightning:layout multipleRows=”true”>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″>{!v.account.Name}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″>{!v.account.AccountNumber}
</lightning:layoutItem>
<lightning:layoutItem size=”12″ mediumDeviceSize=”6″>{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>
A company’s support process dictates that any time a Case is closed with a Status of ‘Could not fix’, an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case.What is the correct way to automate this using an Apex trigger?
A. An after update trigger that creates the Engineering Review record and inserts it
B. A before update trigger that creates the Engineering Review record and inserts it
C. An after upsert trigger that creates the Engineering Review record and inserts it
D. A before upsert trigger that creates the Engineering Review record and inserts it
A. An after update trigger that creates the Engineering Review record and inserts it
A company processes Orders within their Salesforce instance. When an Order’s status changes to ‘Paid’ it must notify the company’s order management system (OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce. What is the optimal method to implement this?
A. Generate the Enterprise WSDL and use it to make a callout to the OMS.
B. Generate the Partner WSDL and use it to make a callout to the OMS.
C. Create an Outbound Message that contains the session ID and send it to the OMS.
D. Create an Apex trigger and make a callout to the OMS from the trigger.
C. Create an Outbound Message that contains the session ID and send it to the OMS.
Consider the Apex controller above, that is called from a Lightning Aura Component.
What is wrong with it?
A. Line 1: class must be global
B. Lines 1 and 6: class and method must be global
C. Line 6: method must be static
D. Line 8: method must first serialize the list to JSON before returning
C. Line 6: method must be static
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 the testSetup method.
C. Add @testVisible to the method in the class the developer is testing.
D. Use system.assert() in testSetup to verify the values are being returned.
B. Call the Apex class method from a testMethod instead of the testSetup method.
A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen. Which functionality consideration impacts the final decision?
A. Does the screen need to be rendered as a PDF?
B. Does the screen need to be accessible from the Lightning Experience UI?
C. Will the screen make use of a JavaScript framework?
D. Will the screen be accessed via a mobile app?
A. Does the screen need to be rendered as a PDF?
A developer wishes to improve runtime performance of Apex calls by caching results on the client.
What is the best way to implement this?
A. Decorate the server-side method with @AuraEnabled(cacheable=true).
B. Set a cookie in the browser for use upon return to the page.
C. Call the setStorable() method on the action in the JavaScript client-side code.
D. Decorate the server-side method with @AuraEnabled(storable=true).
A. Decorate the server-side method with @AuraEnabled(cacheable=true).
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?
A. Map<String, String> statusMap = new Map<String, String>{‘Customer’=>’Active’, ‘Prospect’=>’Pending’} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( statusMap.containsKey(a.Type) ) { a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; } accountUpdates.add(a); } update accountUpdates;
B. Map<String, String> statusMap = new Map<String, String>{'Customer'=>'Active', 'Prospect'=>'Pending'} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account WHERE Status IN :statusMap.keySet()]){ a.Status = statusMap.get(a.Type); accountUpdates.add(a); } update accountUpdates;
C. List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( String.isNotBlank(a.Type) && a.Type == 'Customer' ){ a.Status = 'Active'; } if ( String.isNotBlank(a.Type) && a.Type == 'Prospect' ){ a.Status = 'Pending'; } accountUpdates.add(a); } update accountUpdades;
D. List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; accountUpdates.add(a); } update accountUpdates;</Account></Account></Account></Account></Account></Account></Account></Account>
A. Map<String, String> statusMap = new Map<String, String>{‘Customer’=>’Active’, ‘Prospect’=>’Pending’} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( statusMap.containsKey(a.Type) ) { a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; } accountUpdates.add(a); } update accountUpdates;</Account></Account>
A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available.
What change should be applied to the component?
A. Expose it in the markup using the implements and access attributes.
B. Delete the component, metadata, and Apex controller and recreate them.
C. Refresh the sandbox and upgrade it to the latest API version.
D. Look for errors in the logic in the JavaScript controller.
A. Expose it in the markup using the implements and access attributes.
What is a benefit of JavaScript remoting over Visualforce Remote Objects?
A. Allows for specified re-render targets
B. Does not require any Apex code
C. Does not require any JavaScript code
D. Supports complex server-side application logic
D. Supports complex server-side application logic
Recently a Salesforce org’s integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce.
The flow of data is as follows:
✑ The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds.
✑ If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds.
✑ If a match is not found, the integration will create a Lead and a Task for that newly created Lead.
What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?
A. Use the REST API as well as the SOAP API to effectively double the API calls allowed in a 24-hour period.
B. Create an Inbound Message that, using Flow, can do all of the logic the integration code was doing.
C. Write a custom Apex web service that, given an email address, does all of the logic the integration code was doing.
D. Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.
D. Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.
A company wants to build a custom Lightning Component that will display a specified Account Field Set and that can only be added to the Account record page.
Which design resource configuration should be used?
A. <design:component> <design:attribute></design:attribute> <sfdc:objects> <sfdc:object>FieldSet</sfdc:object> </sfdc:objects> </design:component>
B. <design:component> <design:attribute></design:attribute> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>
C. <design:component> <aura:attribute></aura:attribute> <sfdc:objects> <sfdc:object>FieldSet</sfdc:object> </sfdc:objects> </design:component>
D. <design:component> <aura:attribute></aura:attribute> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>
B. <design:component> <design:attribute></design:attribute> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>
A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration is periodically reporting errors.
Which change should the developer make to ensure the integration is not affected with minimal impact to business logic?
A. Deactivate the Trigger before the Integration runs.
B. Use the Database method with allOrNone set to False.
C. Use a Try/Catch block after the insert statement.
D. Remove the Apex Class from the Integration User’s Profile.
B. Use the Database method with allOrNone set to False.
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 Member record related to the Contact with the Contact’s state.
Consider the following: A mass update of 200 Account records’ addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.
What will happen when the mass update occurs?
A. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements. Most Voted
B. There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML statements.
C. There will be no error, since the limit on the number of records processed by DML statements is 50,000.
D. The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements.
A. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.
A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail.
What is the optimal way for a developer to fix the issue?
A. Add a before insert trigger on Account to set the value of the required field.
B. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.
C. Change the required field to be a validation rule that excludes the System Administrator profile.
D. Add the required field to the data setup for all of the unit tests.
B. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.
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 in a try/catch block.
D. Use ProcessBuilder to catch the error.
C. Use an AuraHandledException in a try/catch block.
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, Name, NumberOfEmployees
FROM Account WHERE Name = :accountName];
return account;
}
}
Consider the Apex class above that defines a RemoteAction used on a Visualforce search page.
Which code snippet will assert that the remote action returned the correct Account?
A. Account a = controller.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );
B. MyRemoter remote = new MyRemoter(); Account a = remote.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );
C. MyRemoter remote = new MyRemoter(‘TestAccount’); Account a = remote.getAccount (); System.assertEquals( ‘TestAccount’, a.Name );
D. Account a = MyRemoter.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );
D. Account a = MyRemoter.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );
A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page.
Which component should be added to the Visualforce page to display the message?
A. <apex:message></apex:message>
B. <apex:facet></apex:facet>
C. <apex:pageMessage></apex:pageMessage>
D. <apex:pageMessages></apex:pageMessages>
D. <apex:pageMessages></apex:pageMessages>
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 could take longer than 60 seconds to complete.
D. Over 10 callouts will be made in a single transaction.
A. The callouts will be made in an Apex Trigger.
A developer wants to call an Apex Server-side Controller from a Lightning Aura Component.
What are two limitations to the data being returned by the Controller? (Choose two.)
A. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.
B. Lists of Custom Apex Classes cannot be returned by Apex Controllers called by Lightning Aura Components.
C. Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to.
D. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.
A. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.
D. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.
Which interface needs to be implemented by a Lightning Component so that it may be displayed in modal dialog by clicking a button on a Lightning Record page?
A. force:lightningQuickAction
B. lightning:quickAction
C. lightning:editAction
D. force:lightningEditAction
A. force:lightningQuickAction
Sometimes events on Salesforce need to be handled by an external system due to the scale or type of process being executed. Consider the use case of a user in
Salesforce needing to get pricing for an order they are building in Salesforce while on the phone with a customer.
The pricing logic already exists in a third-party system. Instead of recreating this logic in Salesforce, it will be leveraged by making a request of the third-party system. The response, in this case the pricing, will be returned and stored back in Salesforce.
What is the optimal solution?
A. A Visualforce page that can make a real-time Apex callout to display and save the pricing back in Salesforce
B. An Apex trigger that upon saving the Order will make a real-time Apex callout, saving the pricing back in Salesforce
C. A Process Builder process and Outbound Message to fetch the pricing upon save and store the pricing in Salesforce
D. An ETL tool to process batches of newly saved Orders every few minutes to store the pricing back in Salesforce
A. A Visualforce page that can make a real-time Apex callout to display and save the pricing back in Salesforce
What are three benefits of using declarative customizations over code? (Choose three.)
A. Declarative customizations cannot generate run time errors.
B. Declarative customizations will automatically update with each Salesforce release.
C. Declarative customizations do not require user testing.
D. Declarative customizations are not subject to governor limits.
E. Declarative customizations generally require less maintenance.
B D E
Which use case can only be performed by using asynchronous Apex?
A. Scheduling a batch process to complete in the future
B. Processing high volumes of records
C. Updating a record after the completion of an insert
D. Calling a web service from an Apex trigger
D. Calling a web service from an Apex trigger
@isTest
static void testIncrement() {
Account acct = new Account(Name = ‘Test’);
acct.Number_Of_Times_Viewed__c = 0;
insert acct;
AuditUtil.incrementViewed(acct.Id);
Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0]
System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c);
}
The test method above calls an @future method that increments the Number_of_Times_Viewed__c value. The assertion is failing because the
Number_of_Times_Viewed__c equals 0.
What is the optimal way to fix this?
A. Change the initialization to acct.Number_Of_Times_Viewed__c = 1.
B. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
C. Add Test.startTest() before and Test.stopTest() after insert acct.
D. Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).
B. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
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 call to Salesforce should be made that creates an Order record in Salesforce and relates it to the proper Account.
What is the optimal way to implement this?
A. Perform a REST GET on the Account and a REST POST to update the Order__c with the Account’s record ID.
B. Perform a REST PATCH to upsert the Order__c and specify the Account’s Customer_Number__c in it.
C. Perform a REST POST to update the Order__c and specify the Account’s Customer_Number__c in it.
D. Perform a REST GET on the Account and a REST PATCH to upsert the Order__c with the Account’s record ID.
B. Perform a REST PATCH to upsert the Order__c and specify the Account’s Customer_Number__c in it.
What are three benefits of using static resources in Visualforce and Lightning Components? (Choose three.)
A. Static resource files are automatically minified.
B. Static resource files can be referenced by using the $Resource global variable instead of hardcoded IDs.
C. Static resource files can be packaged into a collection of related files in a zip or jar archive.
D. Static resource files do not count against an organization’s quota of data storage.
E. Relative paths can be used in files in static resource archives to refer to other content within the archive.
B C E
A company has a native iOS app for placing orders that needs to connect to Salesforce to retrieve consolidated information from many different objects in a JSON format.
Which is the optimal method to implement this in Salesforce?
A. Apex REST Web Service
B. Apex SOAP Web Service
C. Apex SOAP Callout
D. Apex REST Callout
A. Apex REST Web Service
A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an
Opportunity’s Probability is greater than 50%.
What is the optimal way to automate this?
A. Use an Apex Trigger on Opportunity.
B. Build a Flow on Opportunity. Most Voted
C. Create a Workflow on Opportunity.
D. Build a Process on Opportunity.
B. Build a Flow on Opportunity.
A company represents their customers as Accounts in Salesforce. All customers have a unique Customer_Number__c that is unique across all of the company’s systems. They also have a custom Invoice__c object, with a Lookup to Account, to represent invoices that are sent out from their external system. This company wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer is paying their bills on time.
What is the optimal way to implement this?
A. Ensure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly.
B. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice.
C. Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly.
D. Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.
A. Ensure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly.
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 and exceptions.
B. Turn off all Workflow Rules, then turn them on one at time to see which one causes the error.
C. Add system.debug() statements to the code and use the Developer Console logs to trace the code.
D. Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.
C. Add system.debug() statements to the code and use the Developer Console logs to trace the code.
A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?
A. Create a Process, call an Apex @future(callout=true) method from it, and make the callout from that Apex method.
B. Create a Process, call an Apex @InvocableMethod from it, and make the callout from that Apex method.
C. Create an after insert trigger, call an Apex @InvocableMethod method from it, and make the callout from that Apex method.
D. Create an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method.
D. Create an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method.
Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
A. insert (records, false)
B. Database.insert(records, false)
C. Database.insert(records, true)
D. insert records
B. Database.insert(records, false)
Which two relationship queries use the proper syntax? (Choose two.)
A. SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry = ‘Media’
B. SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
D. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = ‘Media’
C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
D. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = ‘Media’
A developer built a Component to be used at the front desk for quests to self-register upon arrival at a kiosk. The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk.
What should be used?
A. Application Event
B. DML Operation
C. Component Event
D. ChangeLog
A. Application Event
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity’s Account?
A. List <Contact> contactList = new List <Contact>(); for(Opportunity o : opportunityList){ Account a = [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id = :o.AccountId] contactList.addAll(a.Contacts); )
B. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for (Opportunity o : opportunityList){ contactIds.add(o.ContactId); } for(Contact c : [SELECT Id FROM Contact WHERE Id IN :contactIds]){ contactList.add(c); }
C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }
D. List <Contact> contactList = new List <Contact>(); for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId] ){ contactList.add(c); }</Contact></Contact></Id></Id></Contact></Contact></Id></Id></Contact></Contact></Contact></Contact>
C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }</Id></Id></Contact></Contact>
An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.
When a test batch of records is loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
What is the most extendable way to update the Apex Trigger to accomplish this?
A. Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.
B. Use a List Custom Setting to disable the Trigger for the user who does the data loading.
C. Add the Profile Id of the user who does the data loading to the Trigger so the Trigger won’t fire for this user.
D. Add a Validation Rule to the Contract to prevent Contract creation by the user who does the data loading.
A. Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.
Business rules require a Contact to always be created when a new Account is created.
What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?
A. Use the Database.Delete method if the Contact insertion fails.
B. Use the Database.Insert method with allOrNone set to False.
C. Disable Validation rules on Contacts and set default values with a Trigger.
D. Use setSavePoint() and rollback() with a try/catch block.
D. Use setSavePoint() and rollback() with a try/catch block.
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</Account></Account>
FROM Region__c -
WHERE Name = :anAccount.Region_Name__c
];
anAccount.OwnerId = theRegion.Region_Manager__c;
accountList.add( anAccount );
}
update accountList;
}
Consider the above trigger intended to assign the Account to the manager of the Account’s region.
Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)
A. Use a Map to cache the results of the Region__c query by Id.
B. Move the Region__c query to outside the loop.
C. Remove the last line updating accountList as it is not needed.
D. Use a Map accountMap instead of List accountList.
B. Move the Region__c query to outside the loop.
C. Remove the last line updating accountList as it is not needed.
Example 1:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get(‘expr0’));
}
Example 2:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get(‘theAverage’));
}
Example 3:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get.AVG());
}
Example 4:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug (‘Average amount’ + ar.theAverage);
}
Which two of the examples above have correct System.debug statements? (Choose two.)
A. Example 1
B. Example 2
C. Example 3
D. Example 4
A. Example 1
B. Example 2
Which method should be used to convert a Date to a String in the current user’s locale?
A. Date.format
B. String.format
C. String.valueOf
D. Date.parse
A. Date.format
A company has a custom object, Order__c, that has a required, unique, external ID field called Order_Number__c.
Which statement should be used to perform the DML necessary to insert new records and update existing records in a List of Order__c records?
A. upsert orders;
B. upsert orders Order_Number__c;
C. merge orders Order_Number__c;
D. merge orders;
B. upsert orders Order_Number__c;
A company uses an external system to manage its custom account territory assignments. Every quarter, millions of Accounts may be updated in Salesforce with new Owners when the territory assignments are completed in the external system.
What is the optimal way to update the Accounts from the external system?
A. Bulk API
B. SOAP API
C. Apex REST Web Service
D. Composite REST API
A. Bulk API
A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the caller’s account number before proceeding with the rest of their call script.
Following best practices, what should a developer use to meet this requirement?
A. Apex Trigger
B. Process Builder
C. Flow Builder
D. Approvals
C
What is the optimal technique a developer should use to programmatically retrieve Global Picklist options in a Test Method?
A. Use the Schema namespace.
B. Use a static resource.
C. Perform a callout to the Metadata API.
D. Perform a SOQL Query.
A. Use the Schema namespace.
A company has a web page that needs to get Account record information, given its Salesforce record ID, from JavaScript on the page and then display it.
Which method of integration is optimal?
A. REST API
B. Apex SOAP Web Service
C. Soap API
D. Apex REST Web Service
D. Apex REST Web Service
A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes. Recently, users notice that fields that were recently added for one department suddenly disappear without warning. Also, Workflows that once sent emails and created tasks no longer do so. Which two statements are true regarding these issues and resolution? Choose 2 answers
A. A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production.
B. The administrators are deploying their own Change Sets, thus deleting each other’s fields from the objects in production.
C. The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production
D. Page Layouts should never be deployed via Change Sets, as this causes Workflows and Field-level Security to be reset and fields to disappear.
A. A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production.
C. The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production
A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page.
Which feature of Apex code is required to facilitate this solution?
A. SOSL queries
B. describeSObjects()
C. Dynamic Schema binding
D. REST API
B. describeSObjects()
Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b.
These are the fields on Customer_Transaction__b:
Account__c -
Program__c -
Points_Earned__c -
Location__c -
Transaction_Date__c -
The following fields have been identified as Index Fields for the Customer_Transaction__b object: Account__c, Program__c, and Transaction_Date__c.
Which SOQL query is valid on the Customer_Transaction__b Big Object?
A. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c =’Shoppers’ AND Transaction_Date__c=2019-05-31T00:00Z
B. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c LIKE ‘Shop%’ AND Transaction_Date__c=2019-05-31T00:00Z
C. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c INCLUDES (‘Shoppers’, ‘Womens’) AND Transaction_Date__c=2019-05-31T00:00Z
D. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c EXCLUDES (‘Shoppers’, ‘Womens’) AND Transaction_Date__c=2019-05-31T00:00Z
A. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c =’Shoppers’ AND Transaction_Date__c=2019-05-31T00:00Z
Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex
Controller to get the data it needs.
What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?
A. Apex Batch job that counts the number of Opportunity records
B. SUM() SOQL aggregate query on the Opportunity object
C. SOQL for loop that counts the number of Opportunities records
D. COUNT() SOQL aggregate query on the Opportunity object
D. COUNT() SOQL aggregate query on the Opportunity object
A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.
What can a developer to do address the issue?
A. Move the prerequisite reference data setup to a TestDataFactory and call that from each test method.
B. Move the prerequisite reference data setup to a @testSetup method in the test class.
C. Move the prerequisite reference data setup to a static method in the test class and call that from each test method.
D. Move the prerequisite reference data setup to the constructor for the test class.
B. Move the prerequisite reference data setup to a @testSetup method in the test class.
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 the optimal way to accomplish this?
A. Use a MassEmailMessage() with an Apex Trigger.
B. Use a Workflow Email Alert.
C. Use an Email Alert with Process Builder.
D. Use a SingleEmailMessage() with an Apex Trigger.
C. Use an Email Alert with Process Builder.
UC Loans is a small company with a part time Salesforce administrator. UC Loans wants to create a Loan__c record whenever an Opportunity is won.
What is the optimal solution for UC Loans to accomplish this?
A. Process Builder
B. Quick Action
C. Workflow Rule
D. Apex Trigger
A. Process Builder