0% found this document useful (0 votes)
98 views

PD1 Dump 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views

PD1 Dump 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

lOMoARcPSD|49503781

Thi DEV 1

Hệ Thống Thông Tin (Học viện Công nghệ Bưu chính Viễn thông)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by SANTHANAM ([email protected])
lOMoARcPSD|49503781

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.

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

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".

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

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

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

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.

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

23. A development team wants to use a deployment script lo automatically deploy lo a


sandbox during their development cycles.
Which two tools can they use to run a script that deploys to a sandbox?
Choose 2 answers
A. Developer Console
B. SFDX CLI
C. VS Code Hoặc Ant Migration Tool( 1 trong 2)
D. Change Sets
24. When a user edits the postal code on an account, a custom account text field named `Timezone`
must be updated based on the value in a PostalCodeToTimezone__c custom object.How can a
developer implement this feature?
A. Build a Flow with Flow builder
B. Build a workflow rule.
C. Build an Account Approval Process
D. Build an Account Assignment Rule
25. Which three steps allow a custom SVG to be included in a Lightning web component?
Choose 3 answers
A. Reference the import in the HTML template.
B. Reference the getter in the HTML template.
C. Upload the SVG as a static resource
D. Import the static resource and provide a getter for it in JavaScript.
E. Import the SVG as a content asset file.
26. Which two statements are true about using the @testSetup annotation in an Apex test class?
(Choose two.)
A. The @testSetup annotation cannot be used when the @isTest(SeeAllData=True)
annotation is used.
B. Test data is inserted once for all test methods in a class.
C. Records created in the @testSetup method cannot be updates in individual test
methods.
D. The @testSetup method is automatically executed before each test method in the test
class is executed.
27. Given the following code snippet, that is part of a custom controller for a Visualforce
page:
In which two ways can the try/catch be enclosed to enforce object and field-level permissions
and prevent the DML statement from being executed if the current logged-in user does not
have the appropriate level of access? Choose 2 answers
A. Use if (Schema.sObjectType.Contact.isAccessible ( ) )
B. Use if (thisContact.Owner = = UserInfo.getuserId ( ) )
C. Use if (Schema, sobjectType, Contact, isUpdatable ( ) )
D. Use if (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable ( ) )
28. Refer to the following Apex code:
Integer x = 0;
Do{
X=1;
X++;
}while(x<1);
System.debug(x);
What is the value of x when it is written to the debug log?
A. 0
B. 2
C. 1
D. 3

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

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.

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

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

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

39. Assuming that 'name; is a String obtained by an <apex:inputText> tag on a Visualforce


page.
Which two SOQL queries performed are safe from SOQL injections? Choose 2 answers
A. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' +
String.escapeSingleQuotes(name) + '%\'';
List<Account> results = Database.query(query);
B. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name.noQuotes()
+ '%\''; List<Account> results = Database.query(query);
C. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name + '%\'';
List<Account> results = Database.query(query);
D. String query = '%' + name + '%';
List<Account> results = [SELECT Id FROM Account WHERE Name LIKE :query];
40. A developer wants to import 500 Opportunity records into a sandbox. Why should the
developer choose to use data Loader instead of Data Import Wizard?
A. Data Loader runs from the developer's browser.
B. Data Import Wizard does not support Opportunities.
C. Data Import Wizard can not import all 500 records.
D. Data Loader automatically relates Opportunities to Accounts.
41. A developer has the following requirements:
Calculate the total amount on an Order.
Calculate the line amount for each Line Item based on quantity selected and price.
Move Line Items to a different Order if a Line Item is not stock.
Which relationship implementation supports these requirements?
A. Order has a Lookup field to Line Item and there can be many Line Items per Order.
B. Line Item has a Lookup field to Order and there can be many Line Items per Order
C. Line Items has a Master-Detail field to Order and the Master can be re-parented.
D. Order has a Master-Detail field to Line Item and there can be many Line Items per Order.
42. A developer wants to mark each Account in a List<Account> as either or Inactive based
on the LastModified field value being more than 90 days.
Which Apex technique should the developer use?
A. A for loop, with a switch statement inside
B. An If/else statement, with a for loop inside
C. A Switch statement, with a for loop inside
D. A for loop, with an if/else statement inside
43. When using SalesforceDX, what does a developer need to enable to create and manage
scratch orgs?
A. Dev Hub
B. Production
C. Environment Hub
D. Sandbox
44. In the following example, which sharing context will myMethod execute when it is
invoked?
A. Sharing rules Ail be enforced by the instantiating class
B. Sharing rules will not be enforced for the running user.
C. Sharing rules will be inherited from the calling context.
D. Sharing rules Ml be enforced for the running user.

Downloaded by SANTHANAM ([email protected])


lOMoARcPSD|49503781

45. A software company uses the following objects and relationships:


* Case: to handle customer support issues
* Defect_c: a custom object to represent known issues with the company's software
* case_Defect__c: a junction object between Case and Defector to represent that a defect Is a
customer issue What should be done to share a specific Case-Defect_c record with a user?
A. Share the parent Case and Defect_c records.
B. Share the parent Case record.
C. Share the parent Defect_c record.
D. Share the Case_Defect_c record.
46. A developer wrote Apex code that calls out to an external system. How should a
developer write the test to provide test coverage?
A. Write a class that extends WebserviceMock
B. Write a class that extends HTTPCalloutMock.
C. Write a class that implements the WebserviceMock interface.
D. Write a class that implements the HTTPCalloutMock interface.
47. A developer created a Lightning web component called statusComponent to be inserted
into the Account record page.
Which two things should the developer do to make the component available?
A. Add <isExposed> true</isExposed> to the statusComponent.js-meta ml file.
B. Add < masterLabel>Account</master Label> to the statusComponent.js-meta ml file.
C. Add <target> lighting _RecordPage </target> to the statusComponent.js-meta ml file.
D. Add<target> Lightning_RecordPage </target> to the statusComponent.js file.
48. An Apex method, getAccounts, that returns a List of Accounts given a search Term, is available for
Lighting Web components to use.
What is the correct definition of a Lighting Web component property that uses the getAccounts
method?
A. @AuraEnabled(getAccounts, ‘$searchTerm’) accountList;
B. @wire(getAccounts, ‘$searchTerm’) accountList;
C. @AuraEnabled(getAccounts, {searchTerm: ‘$searchTerm’}) accountList;
D. @wire(getAccounts, {searchTerm: ‘$searchTerm’}) accountList;
49. A developer has an integer variable called maxAttempts. The developer meeds to ensure
that once maxAttempts is initialized, it preserves its value for the lenght of the Apex
transaction; while being able to share the variable's state between trigger executions. How
should the developer declare maxAttempts to meet these requirements?
A. Declare maxattempts as a constant using the static and final keywords
B. Declare maxattempts as a variable on a helper class
C. Declare maxattempts as a private static variable on a helper class
D. Declare maxattempts as a member variable on the trigger definition.

Downloaded by SANTHANAM ([email protected])

You might also like