100% found this document useful (2 votes)
1K views15 pages

PD1 Set1

1. The most efficient way to ensure a value is always selected for the Food Preference custom picklist field on record creation or update is to mark the field as required on the object's page layout. 2. A validation rule should be used to prevent opportunities from being edited once reaching the Closed/Won stage. 3. The Apex test method failed in the sandbox test framework but succeeded in Execute Anonymous because the test relied on existing data in the sandbox that may not have been present.

Uploaded by

Kashyap Joshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
1K views15 pages

PD1 Set1

1. The most efficient way to ensure a value is always selected for the Food Preference custom picklist field on record creation or update is to mark the field as required on the object's page layout. 2. A validation rule should be used to prevent opportunities from being edited once reaching the Closed/Won stage. 3. The Apex test method failed in the sandbox test framework but succeeded in Execute Anonymous because the test relied on existing data in the sandbox that may not have been present.

Uploaded by

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

1 A custom picklist field, Food Preference , exists on a custom object.

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

2 Universal Containers wants Opportunities to no longer be editable when reaching


the Closed/Won stage:
How should a developer accomplish this?
A. Use a validation rule.
B. Use the Process Automation settings.
c. Use flow builder
D. Mark fields as read-only on the page layout.
Ans - A
-----------------------------------------------------------------------------------
--------------
3 While working in a sandbox, an Apex test fails when run in the Test Framework.
However, running the Apex test logic in the Execute Anonymous window succeeds with
no exceptions or errors.
Why did the method fail in the sandbox test framework but succeed in the Developer
Console?

A. The test method has a syntax error in the code.


B.The test method does not use system.runAs to execute as a specific user
C.The test method relies on existing data in the sandbox.
d.The test method is calling @future method.
Ans - C
-----------------------------------------------------------------------------------
---------------------------------
4. A recursive transaction is initiated by a DML statement creating records for
these two objects:
Accounts
Contacts
The Account trigger hits a stack depth of 16.
Which statement is true regarding the outcome of the transaction?
A. The transaction succeeds as long as the Contact trigger stack depth is less than
or equal to 16
B. The transaction fails and all the changes are rolled back.
C. The transaction is partially committed up until the stack depth is exceeded.
D. The transaction succeeds and all changes are committed to the database
Ans - D
-----------------------------------------------------------------------------------
-----------------
5. Which aspect of Apex programming is limited due to multitenancy?
A The number of records processed in a loop
B. The number of methods in an Apex class
c.The number of active Apex classes
D. The number of records returned from database queries
Ans - D
-----------------------------------------------------------------------------------
--------------------
6.How should a developer write unit tests for a private method in an Apex class?
A.Use the See All Data annotation.
B.Use the TestVisible annotation.
C.Add a test method in the Apex class
D.Add a test method in the Apex class Mark the Apex class as global.
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

A. use if (thisContact.OwnId == UserInfo.getUserId())


B. use if (schema.sObjectType.contact.isUpdatable())
C. use if (schema.sObjectType.Contact.isAccessible());
D. use if (Schema.sObjectType.contact.field.Is_Active__c.isUpdatable());
Ans - B,D
-----------------------------------------------------------------------------------
---------------------------------------
8. What is an example of a polymorphic lookup field in Salesforce?
A. - The ParentId field on the standard Account object
B. The Whatid field on the standard Event object
C. The Leadld and ContactId fields on the standard Campaign Member object
D. A custom field, Links__c, on the standard Contact object that looks up to an
Account of a Campaign
Ans - B

-----------------------------------------------------------------------------------
-------------------------------------
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?

A.public abstract stars shippingcalculator{


public override Shippingcareutor{
public override calculate(){ /* implementation */}
}

B. public abstract class Shippingcalculator {


public virtual void calculate() {/*implementation */}
}

C. public abstract class Shippingcalculator {


public abstract Calculate() {/* implementation */ }
}
D. public abstract class Shippingcalculator{
public void calculate(){ /* implementation */}
}
Ans - B
-----------------------------------------------------------------------------------
---------------------------------------------------------
20. Which statement descnbes the execution order when triggers are associated to
the same object and event?
A. Trigger execution order cannot be guaranteed.
B. Triggers are executed in the order they are created.
C. Triggers are executed alphabetically by trigger name
D. Triggers ane executed in the order they are modified.
Ans - A
---------------------------------------------------------
21. For which three items can a trace flag be configured?
Choose 3 answers
A. Apex Class
B. Visualforce
C. P Apex Trigger
D. User
E. Process Builder
Ans - A,C,D
-----------------------------------------------------------------------------------
----------------------------------------
22. Since Aura application events follow the traditional publish-subscribe model,
which method is used to fire an event?
A. fire()
B. emit()
C. registerEvent()
D. fireEvent()
Ans - A
-----------------------------------------------------------------------------------
---------------------------------
23.A developer needs to create a custom button for the Account object that, when
clicked, will perform a series of calculations and redirect
user to a custom Visualforce page.
Which three attributes need to be defined with values in the <apex page tag to
accomplish this?
Cheese 3 answers
A. standardController
B. extensions
C. renderAs
D. readonly
E. Action
Ans - A,B,C
-----------------------------------------------------------------------------------
-------------------------------------------------------
24. A developer wants to invoke an outbound message when a record meets a specific
criteria.
Which two features satisfy this use case?
Chosse 2 answers
A. Approval Process has the capability to check the record criteria and send an
outbound message without Apex code.
B. Next Best Action can be used to check the record criteria and send an outbound
message
C. Flow Builder can be used to check the record atena and send an outbound message.

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.

What should the developer do to ensure a successful deployment?


A. Ensure BUINESS_RECORDTYPEID is retrieved using Schema.Describe calls.
B. Ensure a record type with ID of BUINESS_RECORDTYPEID exist on production prior
to deployement
C. Ensure the deployment is validated by a System Admin user on Production
D. Ensure BUINESS_RECORDTYPEID is pushed as part of the deployment components
Ans - D
-----------------------------------------------------------------------------------
----
34. What can be developed using the Lightning Component framework?
A.Dynamic web sites
B. Hosted web applications
C. Salesforce integrations
D. Single-page web apps
Ans - D
-----------------------------------------------------------------------------------
------------------------------------------------
35. A developer is implementing an Apex class for a financial system. Within the
class, the variables 'creditAmount and debita 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 actie keyword and assign its value in the class constructor
C. Use the final keyword and assign its value when dedaring the variable
D. Use the static keyword and assign its value in a static initializer.
Ans - A,C
-----------------------------------------------------------------------------------
--------------------------------
36. Universal Containers has an order system that uses an Order Number to identify
an order for customers and service agents. Order records will be imported into
Salesforce.
How should the Order Number field be defined in Salesforce?
A. Number with External ID
B. Direct Lookup
C. Lookup
D. Indirect Lookup
Ans - A

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

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').escapHtml4()
C. String.ValueOf(ApexPages.currentPage().getParameters().get('url_param'))
D. ApexPages.currentPage().getParameters().get('url_param')
Ans - A
-----------------------------------------------------------------------------------
-----------------
44. Which three statements are true regarding custom exceptions in Apex?
Choose 3 answers
A. A custom exception class must extend the system Exception class.
B. A custom exception class cannot contain member variables or methods.
C. A custom exception class can extend other dasses besides the exception class.
D. A custom exception class can implement one or many interfaces.
E. A custom exception class name must end with "Exception's
Ans - A,D,E
-----------------------------------------------------------------------------------
------------------------
45. Instead of sending emails to support personnel directly from Salesforce from
the finish method of a batch process, Universal Containers wants to notify an
external system in the event that an unhandled exception occurs.

What is the appropriate publish/subscribe logic to meet this requirement?


A. Since this only involves sending emails, no publishing is necessary. Have the
external system subscribe to the BatchApexError event.
B.Publish the error event using the addError method and wnte a trigger to subscribe
to the event and notify the external system
C. Publish the error event using the date method and have the external system
subscnbe to the event using Comet
D. Publish the error event using the entourabin method and have the external system
subscribe to the event using CometID.
Ans - D
-----------------------------------------------------------------------------------
--------------------------------------------
46. A developer identifies the following triggers on the Expense_e object:
deleteExpense
applyDefaultToExpense,
validateExpenseUpdate;

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?

A. The try-catch block will handle any DML exceptions thrown.


B. The transaction will sureed and changes will be committed.
C. The transaction will fail due to exceeding the governor limit
D. The try-catch block will handle options thrown by qovenor limits.
Ans - C
-----------------------------------------------------------------------------------
------------
52. A team of many developers work in their own individual orgs that have the same
configuration as the production org.
Which type of brg is best suited for this scenario?
A.Full Sandbox
B. Developer Edition
C. Partner Developer Edition
D. Developer Sandbox
Ans - D
-----------------------------------------------------------------------------------
---------------
53. What are two ways for a developer to execute tests in an org?
Choose 2 answers
A. Bulk API
B. Developer Console
C. Tooling API
D. Metadata API
ans - B,C
-----------------------------------------------------------------------------------
-----------------
54. A developer must modify the following code snippet to prevent the number of
SOQL queries issued from exceeding the platform governor limit
public without sharing class Opportunityservice{
public static List<opportunityLineItem> getOpportunityProducts(set<Id>
opportunityIds){
List<opportunityLineItem> oppLineItems = new
List<OpportunityLineItem>();
for(Id thisOppId : opportunityIds){
oppLineItems.addAll((select Id FROM OpportunityLineItem
WHERE opportunityId =: thisoppId));
}
return oppoLineItems;
}
}
The above method might be called during a thoger execution via a Lightning
component.
Which technique should be implemented to avoid reaching the governor limit?
A. Refactor the code above to perform only one SOQL query fitening by the set of
opportunityIds
B. Use the System.Limits.getQueries() method to ensure the number of fueries 5 less
than 100
C. Refactor the code above to perform the Sool query styf the set penting contains
les 100 IDS.
D. Use the gaten m e t de method to ensure the number of queries is less than 100
Ans - B
-----------------------------------------------------------------------------------
-----------------------------------------
55. What should be used to a create scrach org.
A. workbench
B. Salesforce CLI
C. Developer Console
D. Sandbox refresh
Ans - B
-----------------------------------------------------------------------------------
-----------------------------------
56. A developer considers the following snippet of code:

Boolean isOk;
integer x;
String theString = 'Hello';

if(isOk == false && theString == 'Hello'){


x=1;
}else if(isOk == true && theString == 'Hello'){
x=2;
}else if(isOk != null && theString == 'Hello'){
x=3;
}else {
x=4;
}
Based on this code , what is the value of x?

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. Asynchronous Data Capture Events


B. Calendar Events
C. Developer Log
D. a Event Monitoring log
Ans - D
-----------------------------------------------------------------------------------
----------------------------------------
58. Universal Containers has a 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 fulfil the business request in the quickest and
most effective manner?

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?

A. Add a new Create Records element


B. Add a new Get Records element.
C. add a new Quick Action element (of type create)
D. Add a new Update records element
Ans - A
-----------------------------------------------------------------------------------
------------------------------------------------------------

You might also like