PD1 Set1
PD1 Set1
The
picklist contains the following options: Vegan', Kosher, "No
Preference. The developer must ensure a value is populated every time a record is
created or updated.
What is the most efficient way to ensure a valut is selected every time a record is
saved?
A. Mark the field as Required on the field definition
B. Mark the field as Required on the object's page layout.
C Set a validation rule to enforce a value is selected.
Ans - B
-----------------------------------------------------------------------------------
-------------------------------------------------------
7. Given the following code snippet, that is part of a custom controller for a
Visualforce page:
puble void updatecontact (contact thiscontact)
{
thiscontact.IS_Active__c = false;
try {
update thisContact;
}catch(Exception e)
{
String errormessage = 'An error occorred while updating the contact.
'+e.getMessage());
ApexPages.addMessage(new
ApexPages.message(ApexPages.severity.FATAL.errorMessage));
}
}
In which two ways can the tyre tek be enclosed to enterce obiect and fete 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
-----------------------------------------------------------------------------------
-------------------------------------
9.Universal Containers wants to back up all of the data and attachments in its
Salesforce org once a month.
Which approach should a developer use to meet this requirement?
A. Define a Data Export scheduled job.
B. Use the Data Loader command line.
c. create a schedulable apex class
D. Schedule a report.
Ans - A
-----------------------------------------------------------------------------------
-------------------
10. In the following example, which sharing context will mystethod execute when it
is invoked?
public class myClass
{
public void mymethod() { /* implementation */ }
}
A. Sharing rules will be enforced by the instantiating class
B. Sharing rules will be inherited from the calling context.
C. Shaning rules will be enforced for the running user
D. Sharing rules will not be enforced for the running user.
Ans - B
-----------------------------------------------------------------------------------
----------------------
11. A developer created a new trigger that inserts a Task when a new lead is
created. After deploying to production, as outside integration that reads task
records 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 a try-catch block after the insert statement.
C. Remove the Apex class from the integration user's profile
D. Use the Database method with a torktone set to fine
Ans - D
-----------------------------------------------------------------------------------
----------------------------
12. Which two are best practices when it comes to Aura component and application
event handling
Choose 2 answers
A. Try to use application events as opposed to component events.
B. Reuse the event logic in a component bundle, by putting the logic in the helper.
c. Handle low-level events in the event handler and re-fire them as higher-level
events.
D. Use component events to communicate actions that should be handled at the
application level.
Ans - B,C
-----------------------------------------------------------------------------------
--------------------------------
13. What are two ways that a controller and extension can be specified for a custom
object named "Notice Visualforce page
Choose 2 answers
A.apex:page controller="Notice__c, mycontrollerExtension"
B.apex:page controller="Notice__c" extensions""mycontrollerExtension"
C.apex:page standardcontroller="Notice__c" extension""mycontrollerExtension"
D.apex:page=Notice extends ="mycontrollerExtension"
Ans - B,C
-----------------------------------------------------------------------------------
-----------------------------------------
14. What should a developer do to check the code coverage of a dass after running
all tests?
A View the code Coverage column in the list view on the Apex Classes page.
B. View the Class Test Percentage tab on the Apex Class list view in Salesforce
Setup.
C.View the code coverage percentage for the class using the Overall Code Coverage
panel in the Developer Console
D. Select and run the class on the Apex Test Execution page in the Developer
Console
Ans - B
-----------------------------------------------------------------------------------
----
15. Which process automation should be used to send an outbound message without
using Apex code?
A. Workflow Rule
B. Process builder
C. Strategy Builder
D. Flow Builder
ans - A
-----------------------------------------------------------------------------------
----------
16. A developer has a single custom controller class that works with a Visualforce
Wizard to support creating and editing multiple sObjects.
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 answers
A. String nextpage controller save().getUr();
B. Test.setCurrentPage(pageRef);
C. insert pageRef;
D. ApexPage.currentPage().getParameters().put("input",'TestValue');
E. public ExtendedController(ApexPages.StandardController cntrl(){}
Ans - A,B,D
-----------------------------------------------------------------------------------
----------
18. A developer must create an Apex dass, Contact Sontroller, that a Lightning
component can use to search for Contact records. Users of the Lightning component
should only be able to search for Contact records to which they have access.
Which two will restrict the records correctly?
Choose 2 answers
A. public with sharing class ContactController
B. public class ContactController
C. public inherited sharing class ContactController
D. public without sharing class ContactController
Ans - A,C
-----------------------------------------------------------------------------------
-----------------
19.A develeper must create a shippingcalculator class that cannot be instantiated
and must include a working default implementation
calculate method, that sub-dasses can override.
mentatio
What is the correct implementation of the shoppingcalculator class?
D. Process Builder can be used to check the record catena and send an outbound
message without Apex code
Ans - A,C
-----------------------------------------------------------------------------------
------------------------------------------------------------
25. When a user edits the Postal Code on an Account, a custom Account text field
named Timezone must be updated based on the values in PostalCodeToTimeZone__c ones
custom object.
What should be buik to implement this feature?
A. Account custom trigger
B. Account approval process
C. Account assignment rule
D. Account workflow rule
Ans - A
-----------------------------------------------------------------------------------
---------------------------------------
26. Which annotation exposes an Apex class as a RESTful web service?
A. @RestResource
B. @RemoteAction
C. @HttpInvocable
D. @AuraEnabled
Ans- A
-----------------------------------------------------------------------------------
----------------------------------
27. A developer needs to create a baseline set of data (Accounts, Contacts,
Products, Assets) for an entire suite of tests allowing them to independent
requirements various types of Salesforce Cases
Which approach can efficiently generate the required data for each unit test?
A. Users @TestSetup with a void method.
B. Add @IsTest(seeAllData=true)at the start of the unit test class
C. Create a mock using the Stub API.
D. Create test data before Test.startTest() in the unit test.
Ans - A
-------------------------------------------------------------------------------
28. 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 trigger on the child obiect and use a red-black tree sorting to sum the
amount for all related child objects under the opportunity.
B. Write a Process Builder that links the custom object to the Opportunity.
C. Write a trigger on the child oblect and use an aggregate function to sum the
amount for all related child objects under the opportunity.
D. Use the Streaming API to create real-time roll-up summaries.
Ans- C
-----------------------------------------------------------------------------------
---------------
29. 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 in stock
Which relationship implementation supports these requirements?
A. Line Item has a master-detail field to Order and the master can be re-parented.
B. Order has a master-detail field to Line them and there can be many Lire trems
per Order
C.Line item has a lookup field to Order and there can be many Orders per Line Items
D.Order has a lookup field to Line Item and there can be many Line Items per Order
Ans - A
----------------------------------------------------------------------------------
30. Universal Containers recently transitioned from Classic to Lightning
Experience. One of its business processes requires certain values from the
Opportunity object to be sent via an HTTP REST callout to its external order
management system based on a user-initiated action on the Opportunity detail page.
Example values are as follows:
Amount
Amount
Account
Which two methods should the developer implement to fulfill the business
requirement?
Choose answers
A. Create a Process Builder on the Opportunity object that executes an Apex
immediate action to perfom the 12 REST callout whenever the Opportunity is updated.
B. Create an after update trigger on the Opportunity objednat calls a helper method
using @Future(Callout=true)to perform the HTTP REST callout
C. Create a Lightning component that performs the HTTP REST callout and use a
Lightning Action to expose the component on the Opportunity detail page.
D. Create a Visualforce page that performs the HTTP REST callout and use a
Visualforce quckation to expose the component on the Opportunity detail page
Ans- C,D
-----------------------------------------------------------------------------------
-------------------
31. Which exception type cannot be caught?
A. CalloutException
B. LimitException
C. NoAccessException
D. A Custom Exception
Ans - B
-----------------------------------------------------------------------------------
-------------------------
32. A developer writes a trigger on the Account object on the before update event
that increments a count field. A workflow rule also increments the count field
every time that an Account is created or updated. The field update in the workflow
rule s configured to not re-evaluate workflow rules.
What is the value of the count field on the Account? an Account is inserted with an
initial value of zero, assuming no other automation logic is implemented
on the Account?
A. 2
B. 3
C. 1
D. 4
Ans- A
-----------------------------------------------------------------------------------
-------------------------
33. Given the following trigger implementation:
trigger loadtrigger on Load before update)
final ID BUSINESS RECORDTYPEID = *0125000000090ad';
For(Lead thisLead :trigger.new){
if(thisLead.company != null && thisLead.RecoratypeId != BUSINESS
RECORDTYPEID){
thistLead.Recordtyped = BUSINESS RECORDTYPEID;
}
}
}
The developer receives deployment errors every time a deployment is attempted from
a sandbox to Production.
-----------------------------------------------------------------------------------
---------------------------
37. A developer created these three roll-up summary fields on the custom object,
Project__c:
Total_Timesheet__c
Total_Approved_Timesheet__c
Total_Rejected_Timesheet__c
The developer is asked to create a new field that shows the ratio between
rejected and approved timesheets for a given project.
What are two benefits of choosing a formula field instead of an Apex trigger
to fulfill the request?
Choose 2 answers
A. A test class will validate the formula field during deployment.
B. A formula field will trigger existing automation when deployed.
C. A formula field will calculate the value retroactivelor existing records.
D. Using a formula field reduces maintenance overbes
Ans - B,C
-----------------------------------------------------------------------------------
----------------------------------
38. The values "High", Medium, and low are identified as common values for multiple
picklists across different objects.
What is an approach a developer can take to streamline maintenance of the picklists
and their values, while also restricting the values to the ones mentioned above?
A. Greate the Packlist on each object as a required field and select "Display
values alphabetically not in the order entered
B. Create the Packlist on each object and use a Global Pitklist Value Set
containing the values.
C. Create the Packlist on each object and select "Restrict picklist to the values
defined in the value set
D. Create the Picklist of each object and add a validation rule to ensure data
integrity.
Ans - B
-----------------------------------------------------------------------------------
-------------------------------
39. A custom Visualforce controller calls the ApexPages. adde sage () method, but
no messages are rendering on the page
Which component should be added to the Visualforce page to display the message?
A. <apex:pageMessages />
B. <apex:pageMessage severity="info" />
C. <apex:factet name ="messages" />
D. <apex:message for ="info" />
Ans - A
-----------------------------------------------------------------------------------
--------
41. What is the result of the following code?
Account a: new Account();
Database.insert(a,false);
A. The record will not be created and an exception will be thrown.
B. The record will be created and a message will be in the debug log.
C. The record will be created and no error will be reported.
D. The record will not be created and no error will be reported.
Ans - D
------------------------------------------------------------------------------
42. 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. Developer orgs
B. full Copy sandboxes
C. Scratch orgs
D. Developer sandboxes
Ans - C
-----------------------------------------------------------------------------------
---------------------------------------
43. A developer has an Apex controller for a Visualforce page that takes an ID as a
URL parameter.
The triggers process before delete, before insert, and before update Events
respectively
Which to techniques should the developer implement to ensure tngger best
practices are followed?
Choose 2 answers
A. Unify all three triggers in a single tngger on the expert object that indudes
all events.
B. Maintain all three tnggers on the expense e object, but move the Apex legis out
of the trigger definition.
C. Unify the before insert and before update tnggers and use Process Builder for
the delete action
D. Create helper classes to execute the approprate lepic when a record is saved.
Ans - D
-----------------------------------------------------------------------------------
-------------------------
47. A developer is creating a page that allows users to create multiple
Opportunities. The developer is asked to verify the current used's default
Opportunity record type,
and set certain default values based on the record type before inserting the
record.
How can the developer find the current user's default record type?
A. Query the Profile where the ID equals userinfo.9:rotiled() and then use the
profile. Opportunity-gesDefaoltrecordsyped method.
B. Use oppsterity.sObjectType.getd]Describe().getRecordTypeInfo()to get a list of
record types, and iterate through them until isDefaultRecordTypeMapping()
C. Use the scheme_userInfo.Opportunity.getDefaultRecordType() method.
D. Create the opportunity and check the opportunity to stype, which will have the
record ID of the current user's default record type, before inserting
Ans - B
-----------------------------------------------------------------------------------
-----------------------------------------
48. Which three Salesforce resources can be accessed from a Lightning web
component?
Choose 3 answers
A. Third-party web components
B. SVG resources
C. Static resources
D. Content asset files
E. All external libranes
Ans - B,C,E
-----------------------------------------------------------------------------------
-------
49. Universal Containers uses a Master-Detail relationship and stores the
availability date on each tine 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 LATEST formula on each of the latest availability date fields.
B. Use a CEILING formula on each of the latest availability date fields.
C. usea MAx Roll-Up Summary field on the latest availability date fields.
D. USE DAYS formula on each of the availability date fields and a COUNT Roll-Up
Summary field on the Order.
Ans - D
-----------------------------------------------------------------------------------
-----------------
50. A Next Best Action strategy uses an Enhance Element that invokes an Apex method
to determine a discount level for number of factors.
What is the correct definition of the Apex method?
A. @InvocableMethod
global Recommendiation getLevel(ContactWrapper input)
{ /* implementation */}
B. @InvocableMethod
global Static ListRecommendiation getLevel(List<ContactWrapper> input)
{ /* implementation */}
C.@InvocableMethod
global List<List<Recommendiation>> getLevel(List<ContactWrapper> input)
{ /* implementation */}
D. @InvocableMethod
global Static List<List<Recommendiation>> getLevel(List<ContactWrapper>
input)
{ /* implementation */}
Ans - D
-----------------------------------------------------------------------------------
------------------------------
51. 2. Given the following Anonymous block:
List<case> caseToUpdate = new List<Case>();
for(Case thiscase : (SELECT Id,Status From case LIMIT 50000]){
thiscase.Status = 'Morning';
casesToUpdate.add (thiscase);
}
try{
Database.update(caseToUpdate,false);
}catch(Exception e){
System.debug(e.getMessage());
}
What should a developer consider for an environment that has over 10.000 Case
records?
Boolean isOk;
integer x;
String theString = 'Hello';
A. 1
B. 3
C. 4
D. 2
Ans - C
-----------------------------------------------------------------------------------
-----------------------------------
57.Which Salesforce feature allows a developer to see when a user last logged in to
Salesforce if real-time notification is not required?
A. Enable Available for Lightning Experience, Lightning Communities, and the mobile
app on Visualforce pages used by the custom application
B. Set the attribute enablelightning to true in the definition.
C. Incorporate the Salesforce Lightning Design System CSS stylesheet into the
JavaScript applications.
D. Rewrite all Visualforce pages as Lightning components
Ans - C
-----------------------------------------------------------------------------------
----------------------------
59. Flow Builder uses an Apex Action to provide additional information about
multiple Contacts, stored in a custom class, contactIds
Which is the correct definition of the Apex method that gets the additional
information?
A. @InvocableMethod(label='Additional Info')
public ContactInfo getInfo(Id contactId)
{ /* implementation */}
B. @InvocableMethod(label='Additional Info')
public List<ContactInfo>getInfo(List<Id> contactIds)
{ /* implementation */}
C. @InvocableMethod(label='Additional Info')
public static contactInfo getInfo(Id contactIds)
{ /* implementation */}
D. @InvocableMethod(label='Additional Info')
public static List<contactInfo> getInfo(List<Id> contactIds)
{ /* implementation */}
Ans - D
-----------------------------------------------------------------------------------
--------------------------------------
60.Refer to the following code snippet for an environment has more than 200
Accounts belonging to the Technology industry:
for (Account thisccount :(SELECT id, Industry FROM Account LIMIT 150]) {
if(thisAccount.Industry == 'Technology'){
thisAccount.Is_Tech__c =true;
}
update thisAccount;
}
When the code executes, what happens as a result of the Apex transaction?
A. If executed in a synchronous context, the Apex transaction is likely to fail by
exceeding the DML governor limit.
B. The Apex transaction succeeds regardless of any uncaught exception and all
processed accounts are updated.
C. The Apex transaction fails with the following message: sObject row was retrived
via SOQL without querying the requested field: Account.Is_Tech__c
D. If executed in an asynchronous context the Age transaction is likely to fail by
exceeding the OML govemor limit.
Ans- B
-----------------------------------------------------------------------------------
------------------------
61. Universal Containers decides to use exclusively declarative development to
build out a new Salesforce application.
Which three options should be used to build out the database layer for the
application?
Choose 3 answers
A. Triggers
B. Process Buider
C. Roll-up summaries
D. Relationships
E. Cutom objects and fields
Ans - B,C,D
-----------------------------------------------------------------------------------
--------------------------------
62. An org has an existing Flow that creates an opportunity with an Update Records
element. A developer must update the Flow to also create a
Contact and store the created Contact's ID on the Opportunity
Which update should the developer make in the Flow?