Salesforce Certified Platform Developer II Exam Practice Questions (P. 4)
- Full Access (424 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #31
What are three benefits of using declarative customizations over code? (Choose three.)
- ADeclarative customizations cannot generate run time errors.
- BDeclarative customizations will automatically update with each Salesforce release.Most Voted
- CDeclarative customizations do not require user testing.
- DDeclarative customizations are not subject to governor limits.Most Voted
- EDeclarative customizations generally require less maintenance.Most Voted
Correct Answer:
BDE
BDE
send
light_mode
delete
Question #32
Which use case can only be performed by using asynchronous Apex?
- AScheduling a batch process to complete in the future
- BProcessing high volumes of records
- CUpdating a record after the completion of an insert
- DCalling a web service from an Apex trigger
Correct Answer:
D
D
send
light_mode
delete
Question #33
@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?
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?
- AChange the initialization to acct.Number_Of_Times_Viewed__c = 1.
- BAdd Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.Most Voted
- CAdd Test.startTest() before and Test.stopTest() after insert acct.
- DChange the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).
Correct Answer:
A
A
send
light_mode
delete
Question #34
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?
What is the optimal way to implement this?
- APerform a REST GET on the Account and a REST POST to update the Order__c with the Account's record ID.
- BPerform a REST PATCH to upsert the Order__c and specify the Account's Customer_Number__c in it.Most Voted
- CPerform a REST POST to update the Order__c and specify the Account's Customer_Number__c in it.
- DPerform a REST GET on the Account and a REST PATCH to upsert the Order__c with the Account's record ID.
Correct Answer:
B
B
send
light_mode
delete
Question #35
What are three benefits of using static resources in Visualforce and Lightning Components? (Choose three.)
- AStatic resource files are automatically minified.
- BStatic resource files can be referenced by using the $Resource global variable instead of hardcoded IDs.
- CStatic resource files can be packaged into a collection of related files in a zip or jar archive.
- DStatic resource files do not count against an organization's quota of data storage.
- ERelative paths can be used in files in static resource archives to refer to other content within the archive.
Correct Answer:
BCE
BCE
send
light_mode
delete
Question #36
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?
Which is the optimal method to implement this in Salesforce?
- AApex REST Web Service
- BApex SOAP Web Service
- CApex SOAP Callout
- DApex REST Callout
Correct Answer:
A
A
send
light_mode
delete
Question #37
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?
Opportunity's Probability is greater than 50%.
What is the optimal way to automate this?
- AUse an Apex Trigger on Opportunity.
- BBuild a Flow on Opportunity.Most Voted
- CCreate a Workflow on Opportunity.
- DBuild a Process on Opportunity.
Correct Answer:
A
A
send
light_mode
delete
Question #38
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?
What is the optimal way to implement this?
- AEnsure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly.
- BQuery the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice.
- CCreate a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly.
- DUse Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.
Correct Answer:
A
A
send
light_mode
delete
Question #39
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?
What is the optimal method for a developer to troubleshoot this?
- ASet up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.
- BTurn off all Workflow Rules, then turn them on one at time to see which one causes the error.
- CAdd system.debug() statements to the code and use the Developer Console logs to trace the code.Most Voted
- DRun the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.
Correct Answer:
C
C
send
light_mode
delete
Question #40
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?
What is the optimal way to achieve this?
- ACreate a Process, call an Apex @future(callout=true) method from it, and make the callout from that Apex method.
- BCreate a Process, call an Apex @InvocableMethod from it, and make the callout from that Apex method.
- CCreate an after insert trigger, call an Apex @InvocableMethod method from it, and make the callout from that Apex method.
- DCreate an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method.Most Voted
Correct Answer:
D
D
send
light_mode
delete
All Pages