PD1 Dump 5
PD1 Dump 5
Thi DEV 1
Hệ Thống Thông Tin (Học viện Công nghệ Bưu chính Viễn thông)
1. A developer has a single custom controller class that works with a Visualforce Wizard
to support creating and editing multiple subjects. The wizard accepts data from user
inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom
controller?
Choose 3 answers
A. public ExtendedController(ApexPages StandardController cntrl) { }
B. Test.setCurrentPage(pageRef);
C. ApexPages.CurrentPage().getParameters().put('input\', 'TestValue');
D. String nextPage - controller.save().getUrl();
E. insert pageRef.
2. For which three items can a trace flag be configured? (Choose three.)
A. Visualforce
B. Apex Trigger
C. Process Builder
D. User
E. Apex Class
3. Which annotation exposes an Apex class as a RESTful neb service?
A. @RestRtsoorct
B. @RemoteAction
C. @HttpInvocabte
D. @AuraEnaWed
4. 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. Create test data before Test.startTest() in the unit test.
B. Add @isTest(seeAllData=true) at the start of the unit test class.
C. Use @TestSetup with a viod method.
D. Create a nock using the Stud API
5. An Opportunity needs to have an amount rolled up from a custom object that is not in a
master-detail relationship.
How can this be achieved?
A. Write a Process Builder that links the custom object to the Opportunity.
B. Write a trigger on the child object and use an aggregate function to sum the
amount for all related child objects under the Opportunity
C. Write a trigger on the child object and use a red-black tree sorting to sum the
amount for all related child objects under the Opportunity.
D. Use the Streaming API to create real-time roll-up summaries.
6. Universal Containers recently transitioned from Classic to Lighting Experience. One of its
business processes requires certain value from the opportunity object to be sent via HTTP
REST callout to its external order management system based on a user-initiated action on the
opportunity page. Example values are as follow
* Name
* Amount
* Account
Which two methods should the developer implement to fulfill the business requirement?
(Choose 2 answers)
A. Create a Process Builder on the Opportunity object that executes an Apex
immediate action to perform the HTTP REST callout whenever the Opportunity is updated.
B. Create an after update trigger on the Opportunity object that calls a helper method
using
@Future(Callout=true) to perform the HTTP REST callout.
C. Create a Visualforce page that performs the HTTP REST callout, and use a
Visualforce quick action to expose the component on the Opportunity detail page.
D. Create a Lightning component that performs the HTTP REST callout, and use a
Lightning Action to expose the component on the Opportunity detail page.
6. Which exception type cannot be caught ?
A. A custom Exception
B. LimitException
C. CalloutException
D. NoAccessException
7. 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? Choose 2 answers
A. Use the final keyword and assign its value in the class constructor.
B. Use the static keyword and assign its value in the class constructor
C. Use the final keyword and assign its value when declaring the variable.
D. Use the static keyword and assign its value in a static initializer.
8. 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 and approved
A. No test methods will be executed during deployment.
B. A formula field will calculate the value retroactively for existing records.
C. A test class that validates the formula field is needed for deployment.
D. Using a formula field reduces maintenance overhead.
9. The values 'High', 'Medium', and 'Low' are Identified as common values for multiple picklist
across different object. What is an approach a developer can take to streamline maintenance
of the picklist and their values, while also restricting the values to the ones mentioned
above?
A. Create the Picklist on each object and use a Global Picklist Value Set containing
the Values.
B. Create the Picklist on each object as a required field and select "Display values
alphabeticaly, not in the order entered".
C. Create the Picklist on each and add a validation rule to ensure data integrity.
D. Create the Picklist on each object and select "Restrict picklist to the values
defined in the value set".
10. A team of developers is working on a source-driven project that allows them to work
independently, with many different org configurations. Which type of Salesforce orgs should
they use for their development?
A. Scratch orgs
B. Developer sandboxes
C. Full Copy sandboxes
D. Developer orgs
11. Which three statements are true regarding custom exceptions in Apex? (Choose three.)
A. A custom exception class can implement one or many interfaces.
B. A custom exception class cannot contain member variables or methods.
C. A custom exception class must extend the system Exception class.
D. A custom exception class can extend other classes besides the Exception class.
E. A custom exception class name must end with "Exception".
12. A developer has a Apex controller for a Visualforce page that takes an ID as a URL
parameter. How should the developer prevent a cross site scripting vulnerability?
A. String.escapeSingleQuotes(ApexPages.currentPage() .getParameters().
get('url_param'))
B. ApexPages.currentPage() .getParameters() .get('url_param') .escapeHtml4()
C. String.ValueOf(ApexPages.currentPage() .getParameters() .get('url_param'))
D. ApexPages.currentPage() .getParameters() .get('url_param')
13. Universal Containers (UC) decided it will not to send emails to support personnel directly
from Salesforce in the event that an unhandled exception occurs. Instead, UC wants an
external system be notified of the error. What is the appropriate publish/subscribe logic to
meet these requirements?
A. Publish the error event using the Eventbus.publish() method and have the
external system subscribe to the event using CometD
B. Have the external system subscribe to the BatchApexError event, no publishing is
necessary.
C. Publish the error event using the addError() method and have the external system
subscribe to the event using CometD.
D. Publish the error event using the addError() method and write a trigger to
subscribe to the event and notify the external system.
14. Which three Salesforce resources can be accessed from a Lightning web component'
Choose 3 answers
A. Third-party web components
B. Content asset files
C. All external libraries
D. SVG resources
E. Static resources
15. Universal Containers stores the availability date on each Line Item of an Order
and Orders are only shipped when all of the Line Items are available.
Which method should be used to calculate the estimated ship date for an Order?
A. Use a DAYS formula on each of the availability date fields and a COUNT
Roll-Up Summary field on the Order.
B. Use a MAX Roll-Up Summary field on the latest availability date fields.
C. Use a CEILING formula on each of the latest availability date fields.
D. Use a LATEST formula on each of the latest availability date fields.
16. 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. Full Sandbox
B. Developer Sandbox
C. Developer Edition
D. Partner Developer Edition
17. What are two ways for a developer to execute tests in an org? (Choose two.)
A. Tooling API
B. Developer Console
C. Metadata API
D. Bulk API
18. What should be used to create scratch orgs?
A. Salesforce CLI
B. Developer Console
C. Workbench
D. Sandbox refresh
19. Universal Containers has large number of custom applications that were built using a
third-party javaScript framework and exposed using Visualforce pages. The Company wants
to update these applications to apply styling that resembles the look and feel of Lightning
Experience. What should the developer do to fulfill the business request in the quickest and
most effective manner?
A. Set the attribute enableLightning to treu in the definition.
B. Incorporate the Salesforce Lightning Design System CSS stylesheet into the
JavaScript applications.
C. Enable Available for Lightning Experience, Lightning Comminities, and the
mobile app on Visualforce pages used by the custom application.
D. Rewrite all Visualforce pages asLightning components.
20. A developer created these three Rollup Summary fields in the custom object, Project_ct,
Total_timesheets_c
, Total_Approved_timesheet_c
and Total_project_Timesheet_c
The developer is asked to create a new field that shows the ratio between rejected and
approved timesheets for a given project.
Which should the developer use to Implement the business requirement in order to
minimize maintenance overhead?
A. Record-triggered Flow
B. Formula field
C. Apex Trigger
D. Process Builder
21. A develop completed modification to a customized feature that is comprised of two
elements:
Apex trigger
Trigger handler Apex class
What are two factors that the developer must take into account to properly deploy the
modification to the production environment?
A. A p ex c l a s s es mu s t h a v e a t l ea s t 7 5 % c o d e c o v er a g e o r g - w i d e .
B. At least one line of code must be executed for the Apex trigger.
C. All methods in the test classes must use @isTest.
D. Test methods must be declared with the testMethod keyword.
22. A developer created this Apex trigger that calls MyClass.myStaticMethod: trigger myTrigger
on Contact(before insert)
{ MyClass.myStaticMethod(trigger.new, trigger.oldMap); }
The developer creates a test class with a test method that calls MyClass.myStaticMethod, resulting
in 81% overall code coverage.
What happens when the developer tries to deploy the trigger and two classes to production,
assuming no other code exists?
A. The deployment fails because no assertions were made in the test method.
B. The deployment passes because both classes and the trigger were included in the
deployment.
C. The deployment passes because the Apex code has required (>75%) code coverage.
D. The deployment fails because the Apex trigger has no code coverage.
29. Universal Containers recently transitioned from Classic to Lighting Experience. One of its
business processes requires certain value from the opportunity object to be sent via HTTP
REST callout to its external order management system based on a user-initiated action on the
opportunity page. Example values are as follow
* Name
* Amount
* Account
Which two methods should the developer implement to fulfill the business requirement?
(Choose 2 answers)
A. Create a Process Builder on the Opportunity object that executes an Apex
immediate action to perform the HTTP REST callout whenever the Opportunity is updated.
B. Create an after update trigger on the Opportunity object that calls a helper method
using
@Future(Callout=true) to perform the HTTP REST callout.
C. Create a Visualforce page that performs the HTTP REST callout, and use a
Visualforce quick action to expose the component on the Opportunity detail page.
D. Create a Lightning component that performs the HTTP REST callout, and use a
Lightning Action to expose the component on the Opportunity detail page.
30. When importing and exporting data into Salesforce, whichtwo statements are true?
Choose 2 answers
A. Bulk API can be used to bypass the storage limits when importing large data
volumes indevelopment environments.
B. Bulk API can be used to import large data volumes in development environments
without bypassing the storage limits.
C. Data import wizard is a client application provided by Salesforce.
D. Developer and Developer Pro sandboxes have different storage limits.
31. A developer created a custom order management app that uses an Apex class. The order
is represented by an Order object and an Orderltem object that has a master-detail
relationship to Order. During order processing, an order may be split into multiple orders.
What should a developer do to allow their code to move some existing Orderltem records to a
new Order record?
A. Change the master-detail relationship to an external lookup relationship.
B. Create a junction object between Orderltem and Order.
C. Add without sharing to the Apex class declaration.
D. Select the Allow reparenting option on the master-detail relationship.
32. A developer has to Identify a method in an Apex class that performs resource intensive
actions in memory by iterating over the result set of a SOQL statement on the account. The
method also performs a DML statement to save the changes to the database. Which two
techniques should the developer implement as a best practice to esure transaction control
and avoid exceeding governor limits? Choose
2 answers
A. Use the Database.Savepoint method to enforce database integrity.
B. Use Partial DML statements to ensure only valid data is committed.
C. Use the @ReadOnly annotation to bypass the number of rows returned by a
SOQL.
D. Use the System.Limit class to monitor the current CPU governor limit consuption.
33. Which two statements are true about Getter and Setter methods as they relate to
Visualforce?
A. A corresponding Setter method is required for each Getter method.
B. Getter methods pass values from a controller to a page.
C. There is no guarantee for the order in which Getter methods are called.
D. Setter methods always have to be declared global.
34. The Job_Application__c custom object has a field that is a Master-Detail relationship to
the Contact object, where the Contact object is the Master. As part of a feature
implementation, a developer needs to retrieve a list containing all Contact records where the
related Account Industry is ‘Technology’ while also retrieving the contact’s
Job_Application__c records.
A. [SELECT Id, (SELECT Id FROM Job_Applications_r) FROM Contact WHERE
Account.Industry = ‘Technology’];
B. [SELECT Id, (SELECT Id FROM Job_Applications_r) FROM Contact WHERE
Accounts.Industry = ‘Technology’];
C. [SELECT Id, (SELECT Id FROM Job_Applications_c) FROM Contact WHERE
Accounts.Industry = ‘Technology’];
D. [SELECT Id, (SELECT Id FROM Job_Application_c) FROM Contact WHERE
Account.Industry = ‘Technology’];
35. A business has a proprietary order management system (OMS) that creates orders from their
website and fulfills the order. When the order is created in the OMS, an integration also creates an
order record in salesforce and relates it to the contact as identified by the email on the order. As the
order goes through different stages in the OMS, the integration also updates it in salesforce. It is
noticed that each update from the OMS creates a new order record in salesforce. Which two actions
will prevent the duplicate order records from being created in Salesforce?
A. Use the email on the contact record as an external ID.
B. Write a before trigger on the order object to delete any duplicates.
C. Ensure that the order number in the OMS is unique.
D Use the order number from the OMS as an external ID.
36. Which three code lines are required to create a Lightning component on a Visualforce page? Choose
3 answers
A. $Lightning.useComponent
B. <apex:includeLightning/>
C. $Lightning.use
D. $Lightning.createComponent
E. <apex:slds/>
37. When importing and exporting data into Salesforce, which two statements are true? (Choose two.)
A. Bulk API can be used to Import large data volumes in development environments without
bypassing the storage limits.
B. Developer and Developer Pro sandboxes have different storage limits.
C. Bulk API can be used to bypass the storage limits when importing large data volumes in
development environments.
D. Data import wizard is a client application provided by Salesforce.
38. A developer must provide custom user interfaces when users edit a Contact in either Salesforce
Classic or Linghtning Experience.
What should the developers use to override the Contact's Edit button and provide this functionality?
A. A Visualforce page in Salesforce Classice and a Lightning component in Ligthning Experience
B. A Lightning component is salesforce Classic and a Lighting component in Ligthning Experience
C. A Lightning page in Salesforce Classic and Visualforce page in Lightning Experience
D. A Visualforce page on Salesforce Classice and a Lightning page in Lightning Experience