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

Platform Developer I Exam Revision 3 (1)

Uploaded by

Mbarki Israa
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)
106 views

Platform Developer I Exam Revision 3 (1)

Uploaded by

Mbarki Israa
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/ 54

Platform Developer I Exam Revision

Goal : Certification
18/09/204 — 26/09/2024
SalesForce

par : KHLAIFI RAHIL


1/A developer must modify the following code snippet to prevent the number of SOQL queries issued from
exceeding the platform governor limit. public class without sharing OpportunityService( public static
List<OpportunityLineItem> getOpportunityProducts(Set<Id> opportunityIds){ List<OpportunitylineItem>
oppLineItems = new List<OpportunityLineItem>(); for(Id thisOppId : opportunityIds){
oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return
oppLineItems; } } The above method might be called during a trigger execution via a Lightning component.
Which technique should be implemented to avoid reaching the governor limit?

- Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.

=> public class OpportunityService { public static List<OpportunityLineItem> getOpportunityProducts(Set<Id>


opportunityIds) { List<OpportunityLineItem> oppLineItems = [SELECT Id FROM OpportunityLineItem WHERE OpportunityId IN
:opportunityIds]; return oppLineItems; } }

2/A custom Visualforce controller calls the ApexPages,addMessage () method, but no messages are rendering
on the page. Which component should be added to the Visualforce page to display the message?

=> <apex:page controller="YourController">

< apex:pageMessages />

<!-- Other Visualforce page content -->

</apex:page>
A. Apex Flex Queue:
The Apex Flex Queue in Salesforce allows you to manage and monitor queued batch jobs. It holds
up to 100 batch jobs that are waiting to be processed once the currently running jobs are finished.
Only five batch jobs can be processed simultaneously, but additional jobs can wait in the Flex
Queue.

● Use Case: When you have more than five batch jobs submitted, the extra jobs will be
placed in the Flex Queue and executed when one of the currently running jobs finishes.
● Benefits: You can monitor the Flex Queue, reorder jobs, and manage which jobs should be
prioritized for execution.

4/A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration
chat 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?*
Use the Database method with all or None set to false

5/Universal Containers needs to create a custom user interface component that allows users to enter information about their accounts.
The component should be able to validate the user input before saving the information to the database.
What is the best technology to create this component?
Lightning Web Components
Only Three Records Can Be Merged at Once:

The merge operation in Salesforce only allows up to three records to be merged in a single transaction.

The first record you specify in the merge method becomes the "master" record, and the other two records will be
merged into this master record. This is important to consider when dealing with more than three duplicates at once;
you would need to perform multiple merges if more than three duplicates exist.

EXEMPLE :
Lead masterLead = [SELECT Id, Name FROM Lead WHERE Id = 'someId'];

Lead duplicateLead1 = [SELECT Id, Name FROM Lead WHERE Id = 'anotherId'];

Lead duplicateLead2 = [SELECT Id, Name FROM Lead WHERE Id = 'anotherId2'];

merge masterLead duplicateLead1 duplicateLead2;

The Master Record Keeps Its Field Values

● When you merge multiple Leads, one record is the "master" record. This master record keeps its field values
after the merge.
● The other records (called "duplicates") get deleted, but if they have some important values, you can choose
to keep those values before merging.
A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in
the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console?

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

B. The test method is calling an @future method.

C. The test method does not use System.runAs to execute as a specific user.

D. The test method relies on existing data in the sandbox.

What should a developer use to script the deployment and unit test execution as part of continuous integration?

A. VS Code B. Execute Anonymous C. Salesforce CLI D. Developer Console

—-----------------------------------------------------------------------------------------------------------------------------------------------------------------

When migrating a Visualforce page to a Lightning Web Component (LWC) and using Lightning Data Service (LDS) to access record data, the
developer should be aware of the following key security consideration:

Lightning Data Service Enforces Sharing Rules and Field-Level Security (FLS)

Key Point:

● Lightning Data Service respects the organization's security model, including:


○ Field-Level Security (FLS): Users can only view or update fields they have access to, based on their profile or permission set.
○ Sharing Rules: The LDS ensures that users can only access records that they have permission to view, based on the org's
sharing settings.
A developer is migrating a Visualforce page into a Lightning web component.

The Visualforce page shows information about a single record. The developer
decides to use Lightning Data Service to access record data.

Which security consideration should the developer be aware of?

A. Lightning Data Service handles sharing rules and field-level security.

. The isAccessible ( ) method must be used for field-level access checks

C. Lightning Data Service ignores field-level security.

D. The with sharing keyword must be used to enforce sharing rules.


Les Tests :
. Data Created in a @testSetup Method Is Available to All Test Methods

● The data created in the @testSetup method is available to all test methods within the test class.
● This allows developers to set up test data once, reducing duplication and improving test class efficiency.

@isTest The @testSetup Method Runs Once per Test Class


private class MyTestClass {
● The @testSetup method only runs once before the test methods in the class. The test data
@testSetup created in this method is available to all test methods in the class, which avoids the overhead
static void setup() { of creating data multiple times.
● It ensures that the same setup data is used for all tests, leading to consistency and saving on
// Create common test data
DML limits.
Account acc = new Account(Name = 'Test
Account');

insert acc;

@isTest

static void testMethod1() {

// Data from setup method is available


here Account acc = [SELECT Id FROM
Account WHERE Name = 'Test Account'];

System.assertNotEquals(null, acc); }}
Which two statements are true about using the @testSetup annotation in an Apex test class?

A. Test data is inserted once for all test methods in a class.

B. Records created in the test setup method cannot be updated in individual test methods.

C. A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits.

D. Qo The @testSetup annotation is not supported when the GisTest(SeeAllData=True) annotation is used. True: The @testSetup annotation is not supported when the IsTest(SeeAllData=true) annotation is
used, because the purpose of @testSetup is to create test data specific to the test class, and SeeAllData=true is used to access real org data, which contradicts the purpose of isolation in test setup.

A developer wrote an Apex method to update a list of Contacts and wants to make it available for use by Lightning web components.

Which annotation should the developer add to the Apex method to achieve this? a/ @Auraenabled (cacheable=true)

A Lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to
which the searchResults property is wired, should be used?

A. @AuraEnabled(cacheable=false) public static List<Opportunity> search(String term) { /*implementation*/ }

B. @AuraEnabled(cacheable=false) public List<Opportunity> search(String term) { /*implementation*/ }

C. @AuraEnabled(cacheable=true) public List<Opportunity> search(String term) { /*implementation*/ }

D. @AuraEnabled(cacheable=true)

public static List<Opportunity> search(String term) { /* implementation*/ }


Universal Containers has a Visualforce page that
displays a table of every Container__c being rented by a Salesforce DX (Developer Experience) is a set of tools
given Account. Recently this page is failing with a view and features designed to improve the development
state limit because some of the customers rent over process on the Salesforce platform. Here’s a breakdown of
10,000 containers.
what Salesforce DX entails:
What should a developer change about the Visualforce page to help
When using SalesforceDX, what does a developer need to enable
with the page load errors? to create and manage scratch orgs?
A. Implement pagination with a StandardSetController.
A. Production

B. Use lazy loading and a transient List variable.


B. Dev Hub C. Environment Hub D. Sandbox
C. Use JavaScript remotlng with SOQL Offset.
What writing an Apex class, a developer warts to make sure thai all
D. Implement pagination with an OffaetController. functionality being developed Is handled as specified by the
requirements.
When using SalesforceDX, what does a developer need
to enable to create and manage scratch orgs? Which approach should the developer use to be sure that the Apex class is
working according tospecification?
. Production
A. Run the code in an Execute Anonymous block n the Deceloper Consider.
B. Dev Hub
B. Include a savepoint and Database,rollback.
C. Environment Hub
C. Include a try/catch block to the Apex class.
D. Sandbox
D. Create a test class to execute the business logic and run the test in the Developer
Console.
When a user edits the postal Code on an Account, a custom Account text field named.
A software company uses the following objects and relationships:
Timezone' must be updated based on the values in a PostalCodeToTimezone_c custom ogject.

* Case: to handle customer support issues


Which two automationtools can be used to implement this feature?
* Defect_c: a custom object to represent known issues with the company's software
Choose 2 answers
* 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. Approval process

A. Share the parent Case and Defect_c records. B. Fast field Updates record-triggered flow

B. Share the Case_Defect_c record.


C. Account trigger

C. Share the parent Defect_c record.


D. Quick actions
D. Share the parent Case record.
Universal Containers wants a list button to
How does the Lightning Component framework help developers display a Visualforce page that allows users
implement solutions faster? to edit multiple records.
Which Visualforce feature supports this
A. By providing change history and version control requirement?
A.
B. By providing code review standards and processes

C. By providing device-awareness for mobile and desktops B.

D. By providing an Agile process with default steps C.

D.
A development team wants to use a deployment script to automatically deploy to a sandbox during
their development cycles. Which two tools can they use to run a script that deploys to a sandbox?A.
Change Sets

B. Developer Console

A developer identifies the following triggers


C. VSCode on the Expense __c object:
The triggers process before delete, before
D. SFDX CLI insert, and before update events
respectively.
Which two scenarios require an Apex method to be called imperatively from a Which two techniques should the developer
implement to ensure trigger best practices
Lightning web component?
are followed?
Choose 2 answer
Choose 2 answers
A. Calling a method that is external to the main controller for the Lightning web A. Unify all three triggers in a single trigger
component on the Expense__c object that includes all
events.
B. Calling a method that makes a web service callout
B. Unify the before insert and before update
C. Calling a method that is not annotated with cacheable-true triggers and use Flow for the delete action.

D. Calling a method with the click of a button C. Maintain all three triggers on the
Expense__c object, but move the Apex logic
out of the trigger definition.

D. Create helper classes to execute the


appropriate logic when a record is saved.
Universal Containers decides to use exclusively declarative development to build out a Which aspect of Apex programming is limited due to
new Salesforce application. Which three options should be used to build out the database
multitenancy?
layer for the application? Choose 3 answers
A. The number of methods in an Apex Class
A. Relationships

B. Triggers B. The number of records returned from database queries

C. Custom Objects and Fields C. The number of active Apex classes

D. Roll-Up Summaries
D. The number of records processed in a loop
E. Flow
A developer created a Lightning web component called
A developer is tasked to perform a security review of the ContactSearch Apex statusComponent to be inserted into the Account record page.
class that exists in the system. Whithin the class, the developer identifies the Which two things should the developer do to make the
following method as a security threat: List<Contact> performSearch(String component available?
lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact
WHERE LastName Like %'+lastName+'%); } What are two ways the developer can A. Add<target> Lightning_RecordPage </target> to the
update the method to prevent a SOQL injection attack? Choose 2 answers statusComponent.js file.
A. Use the escapeSingleQuote method to sanitize the parameter before its use.
B. Add < masterLabel>Account</master Label> to the
B. Use a regular expression on the parameter to remove special characters. statusComponent.js-meta ml file.

C. Use variable binding and replace the dynamic query with a static SOQL. C. Add <isExposed> true</isExposed> to the
statusComponent.js-meta ml file.
D. Use the @Readonly annotation and the with sharing keyword on the class.

D. Add <target> lighting _RecordPage </target> to the


statusComponent.js-meta ml file.
Which Lightning Web Component custom event property settings enable the event to bubble up the What is an example of a polymorphic lookup field in
containment hierarchy and cross the Shadow DOM boundary? Salesforce?
A. bubbles: tnje, composed: false A. The LeadId and ContactId fields on the standard Campaign
Member object
B. bubbles: false, composed: false

C. bubbles: true, composed: true B. A custom field, Link__c, on the standard Contact object that
looks up to an Account or a Campaign
D. bubbles: false, composed: true
C. The Parentid field on the standard Account object
When the code executes, a DML exception is thrown.

How should a developer modify the code to ensure exceptions are handled gracefully? D. The Whatld field on the standard Event object

A. Implement the upsert DML statement.

B. Implement a try/catch block for the DML.

C. Remove null items from the list of Accounts.

D. Implement Change Data Capture.


A primaryid_c custom field exists on the candidate_c custom object. The filed is used to store each candidate's id number and is marked as Unique in the
schema definition.
As part of a data enrichment process. Universal Containers has a CSV file that contains updated data for all candidates in the system, the file contains
each Candidate's primary id as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are
correctly mapped to a candidate in the system.
Which technique should the developer implement to streamline the data upload?

A. Create a Process Builder on the Candidate_c object to map the records.

B. Upload the CSV into a custom object related to Candidate_c.

C. Create a before Insert trigger to correctly map the records.

D. Update the primaryid__c field definition to mark it as an External Id

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 object and use an aggregate function to sum the amount for all related child objects under the Opportunity

B. Use the Streaming API to create real-time roll-up summaries.

C. Write a Process Builder that links the custom object to the Opportunity.

D. 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.
Which statement describes the execution order when trigger are A developer is asked to prevent anyone other than a user with Sales
associated to the same object and event? Manager profile from changing the Opportunity Status to Closed Lost if
the lost reason is blank.
A. Trigger execution order cannot be : guaranteed. why : In Which automation allows the developer to satisfy this requirement in the
Salesforce, when multiple triggers are associated with the same most efficient manner?
object and event, the execution order of those triggers is not
A. An error condition formula on a validation rule on Opportunity
guaranteed. While Salesforce processes them, the order in
which they run is unpredictable, and developers cannot rely on
B. A record trigger flow on the Opportunity object
the system to execute them in a specific sequence.

C. approval process on the Opportunity object


B. Triggers are executed in the order they are modified

D. An Apex trigger on the Opportunity object


C. Triggers are executed alphabetically by trigger name.

why A : The validation rule would include a condition that checks:


D. Triggers are executed in the order they are created..
1. If the "Opportunity Status" is changed to "Closed Lost."
2. If the "Lost Reason" is blank.
{for (integer i=0 , i=200 , i++) {insert 3. If the user's profile is not "Sales Manager."
acct ; } } ( not sure B or D)
A. Account Is inserted.

B. Accounts are inserted.

C. 200 Accounts are inserted.

D. 201 Accounts are Inserted.


Which three Salesforce resources can be accessed A developer must perform a complex SOQL query that joins two objects
from a Lightning web component? in a Lightning component. How can the Lightning component execute
Choose 3 answers the query?
A. Third-party web components A. Invoke an Apex class with the method annotated as &AuraEnabled to
perform the query.
B. All external libraries
B. Use the Salesforce Streaming API to perform the SOQL query.
C. SVG resources
C. Create a flow to execute the query and invoke from the Lightning
D. Static resources component

E. Content asset files D. Write the query in a custom Lightning web component wrapper ana
invoke from the Lightning component,
Explanation:
AW Computing tracks order information in custom objects called order__c and
order_Line_ c - Currently, all shipping information is stored in the order__c object.
1. SVG resources (C): Salesforce allows Lightning The company wants to expand Its order application to support split shipments so that
Web Components (LWC) to access and display any number of order_Line__c records on a single order__c can be shipped to different
SVG images, which can be used as icons or for locations.
What should a developer add to fulfill this requirement?
custom graphical content.
2. Static resources (D): Static resources (such as A. Order_shipment_Group_c object and master-detail field on order_c
JavaScript libraries, CSS files, or images) are
hosted by Salesforce and can be referenced within B. Order_shipment_Group_c object and master-detail field to order_c and Order Line_c

LWCs.
C. Order_shipment_Group_c object and master-detail field on order_Line_c
3. Content asset files (E): Content assets are files
stored in Salesforce that can be accessed by
D. Order_shipment_Group_c object and master-detail field on order_shipment_Group_c
LWCs, especially for media content like images or
What are three characteristics of change set deployments?
Deployment in salesForce Choose 3 answers

SET EXPLANATION :In programming, a set is a collection of A. Change sets can deploy custom settings data.
distinct, unordered elements where duplicates are not allowed.
Unlike lists or arrays, where items can appear more than once and B. Change sets can be used to transfer records.
the order matters, a set ensures that each item appears only once,
and there’s no defined order. C. Deployment is done in a one-way, single transaction.

D. Change sets can only be used between related


Key Characteristics of a Set: organizations.

1. No Duplicates: Sets automatically E. Sending a change set between two orgs requires a
filter out any duplicate values. deployment connection.
2. Unordered: The items in a set do not
have a particular sequence.
3. Efficient Membership Testing:
Checking if an item is in a set is
generally faster than checking in a list,
as sets use hash-based lookups. EXPLANATION NEXT PAGEE !!!!!!
A. Change sets can deploy custom settings data.

● Explanation: Change sets can deploy metadata but not actual data. Custom settings can be deployed as metadata, meaning their structure or definition, but not
the data they contain. Custom settings data needs to be migrated separately, for example, via the Data Loader or other data migration tools.
● Is this correct?: No – Change sets cannot deploy the data for custom settings.

B. Change sets can be used to transfer records.

● Explanation: Change sets are used to deploy metadata (configuration) between Salesforce orgs, such as objects, fields, and classes. They do not transfer actual
records or data, like leads or opportunities.
● Is this correct?: No – Change sets do not transfer records; they only transfer metadata.

C. Deployment is done in a one-way, single transaction.

● Explanation: This is true. Change sets are deployed in a single transaction. This means all the components in the change set are deployed at once, and if any
component fails, the entire deployment is rolled back.
● Is this correct?: Yes – Change set deployment is a one-way process, and it all happens in one transaction.

D. Change sets can only be used between related organizations.

● Explanation: This is also true. Change sets can only be used between related (connected) Salesforce orgs, such as a sandbox and its associated production org
or between sandboxes of the same production org. To deploy a change set between two orgs, there needs to be a deployment connection between them.
● Is this correct?: Yes – Change sets can only be used between related orgs.

E. Sending a change set between two orgs requires a deployment connection.

● Explanation: Correct. Before you can send a change set between two orgs (e.g., from a sandbox to production), you need to establish a deployment connection
between those orgs. This connection allows you to transfer metadata using change sets.
● Is this correct?: Yes – A deployment connection is required to send change sets between orgs.
Universal Container* decides to use purely declarative development to build out a new Salesforce application.
Which two options can be used to build out the business logic layer for this application?
Choose 2 answer
A. Validation Rules

B. Record- Triggered flow

C. Remote Actions

D. Batch Jobs

Purely declarative development refers to building and configuring applications or systems using point-and-click,
drag-and-drop, or other visual tools, without writing code. In Salesforce and similar platforms,

No Code Required: You build functionality by Salesforce Example:


configuring settings or components rather
than writing custom code. Salesforce provides many declarative tools to create applications and workflows without coding.
UI-Based Tools: Users interact with visual Some of these include:
interfaces to define workflows, data models,
and other system behaviors. ● Process Builder: Automates business processes using a graphical interface.
Faster Development: Since no coding is ● Flow Builder: Creates guided, multi-step workflows by dragging and dropping
needed, changes can be made more quickly elements like forms and decision logic.
and efficiently by non-technical users. ● Validation Rules: Adds conditions to ensure data integrity when users enter records.
Low Maintenance: Declarative solutions are ● Approval Processes: Routes records for approval without writing custom Apex code.
often easier to maintain because they don't ● Reports & Dashboards: Allows users to build custom reports and dashboards
require debugging or managing complex through the UI.
code. ● Schema Builder: Defines object relationships and data models visually.
What is a Custom Event?
Definition: A custom event in Lightning web components allows child A. The parent component can use a public property to pass
components to communicate with parent components. It is a way for the data to the child component.
the child to "bubble up" messages or data to the parent when
something occurs (like a button click). ● Explanation: In Lightning web components, a public property (using the
@api decorator) is defined in the child component. The parent
Usage: To create a custom event, you define it in the child component
component can bind its data to this property in the child component's
and dispatch it when needed. The parent component can listen for this
template. This is the most straightforward way to pass data from a
event and handle it accordingly.
parent to a child component.

A developer created a child Lightning web component nested inside a


parent Lightning web component, parent component needs to pass a
string value to the child component.
In which two ways can this be accomplished?
Choose 2 answers
A. The parent component can use a public property to pass the data to the
child component.

B. The parent component can use a custom event to pass the data to the
child component,

C. The parent component can invoke a method in the child component

D. The parent component can use the Apex controller class to send data
to the child component.
C. The parent component can invoke a method in the child
component.

● Explanation: The parent component can call public methods defined


in the child component using a template reference. This allows the
parent to trigger specific functionality in the child, which could include
passing parameters.

NOT SURE ABOUT IT : it


should be just 1 insertion !!!
A developer at AW Computing is tasked to create the
supporting test class for a programmatic customization that A. Use without sharing on the class declaration.
leverages records stored within the custom object, Pricing
Structure c. AW Computing has a complex pricing structure for ● This option controls the sharing rules for the class but does not directly
each item on the store, spanning more than 500 records. affect test data availability. It may allow access to records that the user
hich two approaches can the developer use to ensure Pricing might not typically see, but it doesn't provide the necessary test data.
_Structure__c records are available when the test class is
executed? B. Use a Test Data Factory class.
Choose 2 answers
● This is a good practice in Apex testing. A Test Data Factory class can be
A. Use without shering on the class declaration.
used to programmatically create and insert test records for
Pricing_Structure__c before executing the tests. This ensures that
B. Use a Test Date Factory class. your test methods have the necessary data without relying on existing
data.
C. Use the @raTeat (seeAllData=true) annotation.
C. Use the @isTest (seeAllData=true) annotation.
D. Use the Test. leadtear{} method,
● This annotation allows the test to access all data in the organization,
including records of Pricing_Structure__c. However, this is
generally discouraged because it makes tests dependent on existing
data, which can lead to inconsistent test results if the data changes.

D. Use the Test.loadData() method.

● This method allows loading data from static resource CSV files into the
test context. If you have a CSV file containing
Pricing_Structure__c records, this would be a valid approach to
ensure that the necessary data is available during the test.
A team of developers is working on a source-driven project that A. Full Copy Sandboxes
allows them to work independently, with many different org
configurations. Which type of Salesforce orgs should they use for ● These are copies of your production environment, including all data and
their development? metadata. They are useful for testing and training but are not ideal for
independent, agile development because they can be large and take
A. Full Copy sandboxes time to refresh.

B. Scratch orgs B. Scratch Orgs

● Scratch orgs are temporary, disposable environments that can be


C. Developer orgs created quickly and are designed for development and testing. They can
be configured to match different org setups and are version-controlled,
D. Developer sandboxes making them perfect for source-driven projects. Developers can work
independently without affecting each other's work.
NOTE
C. Developer Orgs
● Metadata is about the structure and rules governing the data.
● Developer orgs are free Salesforce environments with limited data
storage. They are great for individual development but don't support
Metadata is data about data. It describes the structure, organization,
multiple configurations easily as scratch orgs do.
and properties of data. For example, in Salesforce, metadata
includes things like object definitions, field types, page layouts, and
D. Developer Sandboxes
validation rules.

● Developer sandboxes are copies of your production org's metadata but


It helps in understanding how data is stored and how it can be
not its data. They are useful for development but not as flexible as
manipulated or accessed.
scratch orgs when it comes to configuration and independent work.
Example: The schema of a "Contact" object, including its fields (like
Name, Email) and relationships to other objects.

● Data is the actual content that users work with.


Given the following Apex statement:

What occurs when more than one Account is returned by the SOQL
query?
A. The query falls and an error Is written to the debug log.

B. An unhandled exception is thrown and the code terminates.

why B : List<Account> myAccounts = [SELECT Id, Name FROM


Account];

C. The variable, nvAccount, Is automatically cast to the List data type.

D. The first Account returned Is assigned to myAccour.t.

A developer is writing tests for a class and needs to insert records to


validate functionality.
Which annotation method should be used to create record for every
method in the test class?
A. @StartTest

B. @isTest (SeeAllData-true)

C. @TestSetup

D. @FreTest
The @InvocableMethod annotation in Apex is used to expose an Apex method to be called
from Salesforce automation tools, such as Process Builder or Flow. This allows you to create
custom business logic that can be executed within these tools.

Static Method Requirement: What are three considerations when using the
@InvocableMethod annotation in Apex?
● The method must be declared as static. This means that it belongs to the Choose 3 answers
class itself rather than to a specific instance of the class. This is necessary for
A. A method using the @InvocableMethod annotation
the method to be called without needing to create an object of the class.
must be declared as static
Parameter Types:
B. A method using the @InvocableMethod annotation
● The method can accept a list of input parameters, but those parameters must can be declared as Public or Global.
be wrapped in a specific type. Typically, you use a custom class with properties
that define the inputs. This allows the method to accept multiple records from
C. Only one method using the @InvocableMethod
the calling tool.
annotqation can be defined per Apex class.

public class MyInvocableClass { D. A method using the @InvocableMethod annotation


public class MyInputType { must define a return value.
@InvocableVariable
public String myField; } E. A method using the @InvocableMethod annotation
can have multiple input parameters.
@InvocableMethod
public static void processRecords(List<MyInputType> inputs) {
for (MyInputType input : inputs) {
// Custom logic for each input
} }}
A business has a proprietary Order Management System (OMS) To prevent duplicate order records from being created in Salesforce when updates
that creates orders from their website and fulfills the orders. occur from the Order Management System (OMS), the following actions would be
When the order is created in the OMS, an integration also creates effective:
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 A. Use the order number from the OMS as an external ID.
Salesforce. It is noticed that each update from the OMS creates a
new order record in Salesforce. ● Explanation: By using the order number as an external ID in Salesforce, you
Which two actions will prevent the duplicate order records from can enforce uniqueness for each order. When an update comes from the
being created in Salesforce? OMS, you can use this external ID to find and update the existing order
Choose 2 answers record instead of creating a new one. This approach ensures that only one
record exists for each unique order number.
A. Use the order number from the OMS as an external ID.

C. Ensure that the order number in the OMS is unique.


B. Use the email on the contact record as an external ID.
● Explanation: Ensuring that the order number is unique within the OMS helps
C. Ensure that the order number in the OMS is unique. maintain data integrity. If the OMS generates unique order numbers for each
order, it reduces the likelihood of duplicates being created in Salesforce
D. Write a before trigger on the order object to delete any during the integration process. If the same order number is used again,
duplicates. Salesforce can recognize it as an update to an existing record.
A software company is using Salesforce to track the companies A junction object is a custom object that allows you to
they sell their software to in the Account object. They also use
Salesforce to track bugs in their software with a custom object, create a many-to-many relationship between two other
Bug__c. objects
As part of a process improvement initiative, they want to be able In this case, you would create a junction object (e.g., BugReport__c)
to report on which companies have reported which bugs. Each that includes:
company should be able t report multiple bugs and bugs can
also be reported by multiple companies. ● A lookup field to the Account object.
What is needed to allow this reporting? ● A lookup field to the Bug__c object.
A. Lookup field on Bug__c to Account
represent the many-to-many relationship.
B. Master-detail field on Bug__c to Account

C. Junction object between Bug__c and Account

D. Roll-up summary field of Bug__c on Account

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.ValueOf(ApexPages.currentPage() .getParameters() .get('url_param'))

B. String.escapeSingleQuotes(ApexPages.currentPage() .getParameters(). get('url_param')) there s who says B is the right option!!!

C. ApexPages.currentPage() .getParameters() .get('url_param') .escapeHtml4()

D. ApexPages.currentPage() .getParameters() .get('url_param')


C. escapeHtml4(): This method is
To prevent cross-site scripting (XSS) specifically designed to sanitize HTML by
escaping characters that could be interpreted
vulnerabilities when handling user as HTML tags or entities. By using this
input in an Apex controller, it's method, the input from the URL parameter is
crucial to sanitize any input that may transformed into a safe string that cannot be
be displayed back to the user or executed as code if rendered in the
processed in a way that could Visualforce page, thereby preventing XSS
attacks.
introduce vulnerabilities.

Why Other Options Are Not Ideal:

● A. String.ValueOf(ApexPages.currentPage().getParameters().get('url_param'))
○ This simply converts the input to a string but does not perform any sanitization, leaving it vulnerable to XSS.
● B. String.escapeSingleQuotes(ApexPages.currentPage().getParameters().get('url_param'))
○ While this method helps prevent issues with single quotes, it does not cover all potential XSS vectors, especially those
involving HTML tags.
● D. ApexPages.currentPage().getParameters().get('url_param')
○ This retrieves the parameter directly without any sanitization, making it highly susceptible to XSS attacks.
A developer must create a DrawList class that provides capabilities extends is used for inheriting from a
defined in the Sortable and Drawable interfaces. public interface class, not for implementing interfaces
Sortable { void sort(); } public interface Drawable { void draw(); } Which
is the correct implementation?
In Java and Apex, the correct syntax to
A. Public class DrawList extends Sortable, extends Sortable, extends implement multiple interfaces is to use
Drawable { public void sort() { /*implementation*/ } public void draw() { /* the implements keyword, not
implementation */} extends. A class can implement
multiple interfaces, meaning it will
B. Public class DrawList implements Sortable, Implements Drawable { provide implementations for the methods
defined by those interfaces.
public void sort() { /*implementation*/}
public void draw() { /*implementation*/}
]

C. Public class DrawList implements Sortable, Drawable {


A developer created these three Rollup Summary fields in the custom
object, Project__c:
public void sort() { /*implementation*/} The developer is asked to create a new field that shows the ratio between
public void draw() { /*implementation*/} rejected and approved timesheets for a given project.
} Which should the developer use to implement the business requirement
in order to minimize maintenance overhead?
D. Public class DrawList extends Sortable, Drawable { A. Record-triggered flow

public void sort() { /*implementation*/} B. Formula field


public void draw() { /*implementation*/}
} C. Field Update actions
Universal Containers hires a developer to Explanation: SOSL is optimized for
build a custom search page to help user- searching text across multiple fields and
find the Accounts they want. Users will be multiple objects. It's generally faster than
able to search on Name, Description, and a SOQL for full-text searches, especially when
custom comments field. searching through large amounts of text
Which consideration should the developer data across different fields and objects, as in
be aware of when deciding between SOQL this case (searching on Name, Description, Use SOSL for text searches across multiple
and SOSL? and custom Comments field). fields and objects (A).
Choose 2 answers Use SOQL when needing to return larger
A. SOSL is faster for tent searches. datasets (B).
Explanation: SOQL can return up to
50,000 records in a single query, while
B. SOQL is able to return more records. SOSL can return up to 2,000 records.
Therefore, if the developer needs to
C. SOQL is faster for text searches. retrieve a larger number of records, SOQL
is a better option.
D. SOSL is able to return more records.

A company has a custom object, Order__c, that has a required, unique external ID field called OrderNumber__c.
Which statement should be used to perform the DML necessary to insert new records and update existing records in a list of

upsert: This DML statement checks


order__c records using the external ID field?

A. ordersList: This represents the list of


if records with the given external ID Order__c records you're trying to
already exist. If a record exists, it will insert or update.
B.
update the record. If the record does not OrderNumber__c: This is the external
ID field that Salesforce will use to
exist, it will insert a new one.
C. determine if the record should be
inserted or updated. It ensures that the
D.
operation is performed based on the
unique identifier OrderNumber__c.
Cloud kicks has a muli-screen flow its call Invocable Method: An Apex REST class:
center agents use when handling inbound
service desk calls. ● This method allows you to create an ● While an Apex REST class could be
At one of the steps in the flow, the agents Apex method that can be called
used to expose Salesforce data to
should be presented with a list of order number directly from a flow. In this case, the
and dates that are retrieved from an external external systems, it’s not used to
invocable method would perform a
odrer management system in real time and retrieve data from external systems in
callout to the external order
displayed on the screen. management system to fetch the the context of a flow. Instead, the
What shuold a developer use to satisfy this invocable method would directly
required order data in real-time.
requirement?
● The data fetched by the invocable handle the real-time retrieval of data
A. An outbound message method would then be passed back for the flow.
to the flow and displayed on the
B. An invocae method screen. This approach works well
with Salesforce Flow and is
commonly used when real-time data
C. An Apex Controller
needs to be integrated into a Flow.

D. An apex REST class


A developer is tasked with building a custom Lightning web component to collect Contact information.
The form will be shared among many different types of users in the org. There are security requirements that only
certain fields should be edited and viewed by certain groups of users.
What should the developer use in their Lightning Web Component to support the security requirements?
NB : <force:inputField>
A. aura-input-field
● Framework: Aura Components
● Usage: Primarily used in Aura
Components to create input fields B. force-input-field
that are bound to Salesforce
objects. It automatically binds to
C. lightning-input-field
the fields of a Salesforce object
without the need for explicit data
binding in the code. D. ui-input-field
A company decides to implement a new process where every time What are two considerations for deploying from a sandbox to
an Opportunity is created, a follow up Task should be created and production?
assigned to the Opportunity Owner. Choose 2 answers
What is the most efficient way for a developer to implement this?
A. Should deploy during business hours to ensure feedback can be
A. Apex trigger on Task
Quickly addressed

B. Auto-launched flow on Task


B. All triggers must have at least one line of test coverage.

C. Task actions
C. At least 75% of Aptx code must be covered by unit tests.

D. Record-trigger flow on Opportunity


D. Unit tests must have calls to the System.assert method.

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, isUpdatable ( ) )

B. Use if (thisContact.Owner = = UserInfo.getuserId ( ) )

C. Use if (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable


())

D. Use if (Schema.sObjectType.Contact.isAccessible ( ) )
What are two characteristics related to formulas? A developer wants to get access to the standard price book in the org
Choose 2 answers while writing a test class that covers an OpportunityLineItem trigger.
Which method allows access to the price book?
A. Formulas can reference values from objects.
A. Use @IsTest (SeeAllData=True) and delete the existing standard price
B. Fields that are used in a formula field can be deleted or book
edited wlthojt editing the formjta.
B. Use Test.getStandardPricebookid ( ) to get the standard price book ID.
C. formulas can reference themselves.
C. Use @TestVisible to allow the test method to see the standard price book.
D. Formulas are calculated at runtime and are not stored in the
database D. Use Test.loadData ( )and a static resource to load a standard price book

What should a developer do to check the code coverage of a class


after running all tests?
A. Select and run the class on the Apex est Execution page in the In addition to ensuring the quality of your code, unit tests
Developer Console. enable you to meet the code coverage requirements for
deploying or packaging Apex. To deploy Apex or package it for
B. View the Class test Percentage tab on the Apex Class list view in the Salesforce AppExchange, unit tests must cover at least
Salesforce Setup. 75% of your Apex code, and those tests must pass.

C. View the Code Coverage column in the list on the Apex Classes page.

D. View the code coverage percentage or the class using the Overalll
code Coverage panel in the Developer Console Test tab.
A developer must implement a CheckPaymentProcessor class that provides A developer wants to mark each Account in a
check processing payment capabilities that adhere to what defined for List<Account> as either or Inactive based on the
payments in the PaymentProcessor interface. public interface LastModified field value being more than 90 days.
PaymentProcessor { void pay(Decimal amount); } Which is the correct Which Apex technique should the developer use?
implementation to use the PaymentProcessor interface class?
A. A Switch statement, with a for loop inside
A. Public class CheckPaymentProcessor implements PaymentProcessor {
B. An If/else statement, with a for loop inside
public void pay(Decimal amount);
} C. A for loop, with an if/else statement inside

B. Public class CheckPaymentProcessor extends PaymentProcessor { D. A for loop, with a switch statement inside

public void pay(Decimal amount) {} Using a for loop to iterate over the
} List<Account> and an if/else statement to
check the LastModified field allows the
C. Public class CheckPaymentProcessor implements PaymentProcessor { developer to mark each account as either
Active or Inactive based on the condition.
This is a straightforward and effective
public void pay(Decimal amount) {}
approach for this scenario.
}

D. Public class CheckPaymentProcessor extends PaymentProcessor {

public void pay(Decimal amount);


}
In the Lightning UI, where should a developer look to find
information about a Paused Flow Interview?
A. In the Paused Interviews section of the Apex Flex Queue

B. In the system debug log by Altering on Paused Row Interview

C. On the Paused Row Interviews component on the Home


page

D. On the Paused Row Interviews related List for a given record

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

A. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the
Opportunity detail page.

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 Process Builder on the Opportunity object that executes an Apex immediate action to perform the HTTP REST callout whenever
the Opportunity is updated.

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

A developer created this Apex trigger that calls Myclass.myStaticMethod:

The developer creates a test class with a test method that calls MyClass.myStaticMethod directly, 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 the Apex trigger has no code coverage.

B. The deployment passes because both classes and the trigger were included in the deployment.

C. The deployment fails because no assertions were made in the test method.

D. The deployment passes because the Apex code has the required >75% code coverage.
A credit card company needs to implement the Reason:
functionality for a service agent to process
damaged or stolen credit cards. When the ● Screen-based Flow: This allows for a guided, interactive experience for the service agent.
customers call in, the service agent must gather It can prompt the agent to collect various pieces of information step-by-step, making it
many pieces of information. A developer is
user-friendly and efficient. Flows can also easily incorporate logic to handle different
tasked to implement this functionality.
scenarios based on user input.
What should the developer use to satisfy this
requirement in the most efficient manner?
Why Not the Others:
A. Approval process
● A. Approval Process: This is primarily for routing records for approval and is not suitable
B. Lightning Component for gathering information interactively.
● B. Lightning Component: While a Lightning component could be used, it may require
C. Screen-based flow more development time to implement compared to using a flow, which is designed for this
type of use case.
● D. Apex Trigger: Triggers are used for automated backend processes and wouldn’t provide
D. Apex trigger
an interface for the service agent to gather information interactively.
Create Custom Exceptions
Custom exceptions enable you to specify detailed error messages and have more custom error
handling in your catch blocks.
Exceptions can be top-level classes, that is, they can have member variables, methods and
constructors, they can implement interfaces, and so on.
To create your custom exception class, extend the built-in Exception class and make sure your
class name ends with the word Exception, such as “MyException” or “PurchaseException”. All
exception classes extend the system-defined base class Exception, and therefore, inherits all
common Exception methods.
Like Java classes, user-defined exception types can form an inheritance tree, and catch blocks can catch any object in this inheritance
tree. For example:
public class ExceptionExample {
public virtual class BaseException extends Exception {}
public class OtherException extends BaseException {}

public static void testExtendedException() {


try {
Integer i=0;
// Your code here
if (i < 5) throw new OtherException('This is bad');
} catch (BaseException e) {
// This catches the OtherException
System.debug(e.getMessage());
}
}
}
Which three statements are true regarding
custom exceptions in Apex? (Choose
three.)
A custom exception class can contain member variables and methods. This can be useful
A. A custom exception class cannot contain for storing additional information related to the exception.
member variables or methods.
It is a common convention in many programming languages, including Java and C#, to
B. A custom exception class name must end name custom exception classes with an "Exception" suffix for clarity and readability.
with "Exception".

C. A custom exception class must extend In many languages, including Java, custom exceptions must extend from the Exception
class (or a subclass of it) to be recognized as exceptions.
the system Exception class.

D. A custom exception class can extend While a custom exception can extend other classes, it must ultimately extend the
other classes besides the Exception class. Exception class or one of its subclasses to be treated as an exception.

E. A custom exception class can implement A custom exception class can implement interfaces, allowing it to adhere to specific
one or many interfaces. contracts or behaviors defined by those interfaces.
A. Partial Copy Sandbox
a Sandbox is a separate environment that
allows developers, administrators, and ● Purpose: This type of sandbox is used for testing and development
testers to work on and test applications, purposes. It includes a subset of your production data (up to 5 GB) and all
configurations, and data without affecting the metadata, allowing for testing with real data.
production environment ● Data: Contains some data but is not a complete copy of the production data.

B. Full Sandbox
Which salesforce org has a complete duplicate copy of ● Purpose: This sandbox provides a complete duplicate of your production
the production org including data and configuration? org, including all data and configuration. It's typically used for performance
A. Partial Copy Sandbox testing, user training, or QA.
● Data: Contains a complete copy of all production data.

B. Full Sandbox
C. Developer Pro Sandbox

C. Developer Pro Sandbox ● Purpose: Similar to a Developer Sandbox but with more storage. It's
primarily used for development and testing with configuration and limited
D. Production data.
● Data: Contains no production data by default; it is primarily for development.

D. Production
Key Features of Sandboxes: ● Purpose: This is your live Salesforce environment where real business
1. Isolation operations occur.
2. Testing and Development ● Data: Contains all your actual business data.

3. Data and Configuration


4. Refreshing
5. Deployment
A developer migrated functionality from JavaScript Remoting Which three code lines are required to create a Lightning
to a Lightning web component and wants to use the existing component on a Visualforce page? Choose 3 answers
getOpportunities() method to provide data.
What to do now? A. $Lightning.useComponent

A. The method must be decorated with @AuraEnabled.


B. $Lightning.createComponent

B. The method must be decorated with (cacheable=true).


C. $Lightning.use

C. The method must return a JSON Object.


D. <apex:includeLightning/>

D. The method must return a String of a serialized JSON Array.


E. <apex:slds/>

D. <apex:includeLightning/>: This tag


is necessary to include the Lightning library in
your Visualforce page, enabling the use of
Lightning components.
B. $Lightning.createComponent: This
function is used to create a new Lightning
component programmatically within the
Visualforce page.
C. $Lightning.use: This function is used
to specify the Lightning application to load
and ensures that the correct namespace and
dependencies are included.
E.<apex:slds/> is used in Visualforce
pages to include the Salesforce Lightning
Design System (SLDS) styles : css
A team of many developers work in their own individual A. Partner Developer Edition: This is intended for partners to build applications
orgs that have the same configuration as the production that will be listed on the AppExchange. It may not be suitable for individual
org. developers needing isolated development environments
Which type of org is best suited for this scenario?
C.Developer Edition: This is a standalone Salesforce environment that provides all
A. Partner Developer Edition the features of the Salesforce platform, allowing developers to build and test
applications independently. Each developer can have their own Developer Edition
org, which has a configuration similar to the production org but is completely
B. Developer Sandbox
isolated..
B. Developer Sandbox: While Developer Sandboxes are useful for testing and
C. Developer Edition development, they are copies of the production environment and not individual orgs.
Sandboxes are typically shared among multiple developers.
D. Full Sandbox D. Full Sandbox: This type of sandbox is a complete replica of the production org,
including all data. It's meant for testing and QA but not for individual developer use,
as it can be costly and doesn't provide isolated environments for each developer.
Understanding Trace Flags:
Trace Flags in Salesforce are used for debugging and monitoring the execution of code and processes. They allow you to log
specific information about what's happening in your Salesforce org when certain actions are performed. This is particularly
useful for developers and administrators when troubleshooting issues.

What Can Trace Flags Be Configured For?

You can configure trace flags for the following three items:

1. Apex Code: You can enable debug logging for Apex code to capture details about the execution of your Apex classes
and triggers, which helps in identifying issues or performance bottlenecks.
2. Workflow: Trace flags can be set to log information about workflow rules, including the criteria for rule execution and
the actions taken, which is useful for debugging complex workflows.
3. Validation Rules(user): You can also configure trace flags to log information about validation rules to understand why
certain records are being accepted or rejected based on the rules defined.

For which three items can 2 trace flag be configured? Choose 3 answers How to Set Trace Flags:
A. Apex Class
1. Navigate to Setup in Salesforce.
B. Visualforce 2. In the Quick Find box, type Debug
Logs and select it.
C. User 3. Click New to create a new trace flag,
selecting the user and specifying the
D. Flow log levels for the items you want to
trace.
E. Apex Trager
Ursa Major Solar has a custom object, serviceJob-o, with
What are three capabilities of the <ltng : require> tag when
an optional Lookup field to Account called
loading JavaScript resources in Aura components?
partner-service-Provider_c.
Choose 3 answers ????!!!!!!! donnoww
The TotalJobs-o field on Account tracks the total number
of serviceJob-o records to which a partner service A. Loading scripts In parallel
provider Account is related.
What is the most efficient way to ensure that the Total
B. Loading externally hosted scripts
job_o field kept up to data? !!!!!!!!! donnoww
A. Create a schedule-triggered flow on ServiceJob_o. C. Loading files from Documents

B. Create a record-triggered flow on ServiceJob_o. D. One-time loading for duplicate scripts

C. Create an Apex trigger on ServiceJob_o. E. Specifying loading order

D. Change TotalJob_o to a roll-up summary field.

What should be used to create scratch orgs?


A. Workbench

B. Salesforce CLI

C. Sandbox refresh

D. Developer Console
A developer creates a batch Apex job to update a large number of records, Asynchronous Job Monitoring Page: This
and receives reports of the job timing out and not completing. page provides insights into the status of
What is the first step towards troubleshooting the issue? asynchronous jobs, including batch jobs. By
checking this page, you can gather important
A. Decrease the batch size to reduce the load on the system.
information about the job's execution, such as
how many batches were processed, whether
B. Check the asynchronous job monitoring page to view the job status and any errors occurred, and if the job is still
logs. running or has failed.

C. Check the debug logs for the batch job.

D. Disable the batch job and recreate it with a smaller number of records.

Developers at Universal Containers (UC) use version control to share their


code changes, but they notice that when they deploy their code to Universal Containers wants to back up all of the data and
different environments they often have failures. They decide to set up attachments in its Salesforce org once month. Which
Continuous Integration (CI). approach should a developer use to meet this
What should the UC development team use to automatically run tests as requirement?
part of their CI process?
A. Use the Data Loader command line.
A. Salesforce CLI

B. Create a Schedulable Apex class.


B. Visual Studio Code

C. Schedule a report.
C. Developer Console

D. Define a Data Export scheduled job.


D. Force.com Toolkit
A developer is creating an app that contains Which three data types can a SOQL query return?
multiple Lightning web components. Choose 3 answers
One of the child components is used for
navigation purposes. When a user click a A. Integer
button called.. component, the parent
component must be alerted so it can B. Long
navigate to the next page.
How should this be accomplished?
C. Double
A. Call a method in the Apex controller.
D. sObJect
B. Update a property on the parent.
E. List
C. Fire a notification.

D. Create a custom event.

By creating a custom event in the


child component, you can dispatch
it when the button is clicked. The
parent component can listen for this
event and handle the navigation
logic accordingly.
A developer Is Integrating with a legacy on-premise SQL A developer must write anApex method that will be called from a
database. lightning component. The method may delete an Account stored in the
What should the developer use to ensure the data being accountRec variable.
Integrated is matched to the right records in Salesforce? Which method should a developer use to ensure only users that should
be able to delete Accounts can successfully perform deletion?
A. External Object
A. Schema, sobjectType, Account, isDeletetable ()
B. Formula field
B. AccountRec, ObjecType, ieDeletable ()
C. External ID field
C. accountRec., isDeletable() AccountRec (an instance of an
Account) does not have an
D. Lookup field ObjectType method.
D. Account, isDeletable ()

isDeletable() needs to be called from the


Which two events need to happen when deploying to a production Schema.sObjectType class, not directly on
org? Choose 2 answers Account.

A. All triggers must have at least 75% test coverage.


Schema.sObjectType.Account.isDele
table() checks if the current user has the
B. All Apex code must have at least 75% test coverage. "Delete" permission for the Account object.
This ensures that only users who are
C. All test and triggers must have at least 75% test coverage authorized to delete accounts can perform
combined the operation

D. All triggers must have at least 1% test coverage.


A developer wrote Apex code that calls out
Which Lightning code segment should be written to declare dependencies on a
to an external system. How should a
Lightning component, c:accountList, that is used in a Visualforce page?
developer write the test to provide test
coverage?
A. Write a class that extends
HTTPCalloutMock.

B. Write a class that implements the


WebserviceMock interface.

C. Write a class that extends


WebserviceMock

D. Write a class that implements the


HTTPCalloutMock interface.

Create and Reference a Lightning Out App


<aura:application
To use Lightning Components for Visualforce, define
component dependencies by referencing a Lightning Out app. access="GLOBAL"
This app is globally accessible and extends ltng:outApp. The extends="ltng:outApp">
app declares dependencies on any Lightning component that it <aura:dependency
uses. resource="lightning:button"/>
</aura:application>
Offset : Exemple pour comprendre
Inefficiency with Large Data
Imagine a Long List of Records

● Suppose you have a list of 100 items (like a table of


containers), but you only want to show 10 items at a
time on your Visualforce page or any other interface.
● On the first page, you show the first 10 records (1 to This is why for very large data sets, using a
10). StandardSetController or other
● On the second page, you want to show the next 10 pagination methods is more efficient.
records (11 to 20).
● On the third page, you show records from 21 to 30,
and so on. Universal Containers has a Visualforce page that displays a
table of every Container_c. being ....... Is falling with a view
state limit because some of the customers rent over 10,000
SELECT Name FROM Container__c containers.
What Does OFFSET Do? LIMIT 10 OFFSET 20 What should a developer change about the Visualforce page
to help with the page load errors?
OFFSET is a SOQL keyword that tells Salesforce to skip a
A. Use JavaScript remoting with SOQL Offset.
certain number of records and then retrieve the next set of
records.
B. Use Lazy loading and a transient List variable.
● Example: If you say OFFSET 10, Salesforce will skip
the first 10 records and start showing records from 11 C. Implement pagination with a StandardSetController,
onward.
D. Implement pagination with an OffsetController.
Comparison Between StandardSetController and OffsetController:
StandardSetController: OffsetController:

● What is it? The StandardSetController is a built-in Visualforce ● What is it? This is not a built-in controller like
controller provided by Salesforce that allows developers to implement StandardSetController, but typically refers to a
pagination efficiently. It automatically handles large record sets and custom implementation that uses the SOQL OFFSET
allows navigation through pages of records without exceeding view keyword to retrieve a specific subset of records.
state limits. ● Why Not Use It? The OFFSET keyword in SOQL can
● Why Use It? It reduces the number of records loaded into memory become inefficient with large data sets because it
(view state) at any given time by only displaying a limited number of essentially skips records to retrieve a subset, which can
records per page, which is perfect for handling the scenario of 10,000+ degrade performance as you move further into the
records. record set. Salesforce does not recommend using it for
● How Does It Work? You can specify the page size and navigate large data volumes.
through pages, loading only a subset of records at a time.

comparison
The sales management team at Universal Container requires that the Lead A validation rule is the best way to ensure that a field is
Source field of the Lead record be populated when a.. converted. populated with data before a certain action is taken, such
What should be done to ensure that a user populates the Lead Source
as converting a lead.
field prior to converting a Lead?
A. Create an after trigger on Lead. ● What is a validation rule? A validation rule
enforces that specific criteria are met when saving
B. Use a validation rule. or updating a record. If the criteria aren't met, the
system will display an error message, preventing
C. Use Lead Conversion field mapping. the user from proceeding until the issue is
resolved.
D. Use a formula field.

A developer considers the following snippet of code:


Which three resources in an Azure Component can contain Boolean isOK; integer x; String theString = 'Hello'; if
JavaScript functions? (isOK == false && theString == 'Hello') { x = 1; } else if
A. helper (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?
B. Controllers
A. 4
C. Style
B. 1
D. Renderer
C. 3
E. Design
D. 2
Max Roll-Up Summary Field: This field will look at all A developer Is Integrating with a legacy A developer at Universal Containers is taked
the Line Items related to an Order and return the on-premise SQL database. with implementing a new Salesforce
maximum (latest) availability date from those Line
What should the developer use to ensure application that bwill be maintained
Items. Since Orders are only shipped when all Line
Items are available, the estimated ship date should the data being Integrated is matched to the completely by their company's Salesforce
reflect the latest availability date among all Line Items. right records in Salesforce? admiknistrator.
Which two options should be considered for
A. Lookup field buildig out the business logic layerof the
Universal Containers stores the availability
date on each Line Item of an Order and application?
Orders are only shipped when all of the Line B. External Object Chosse 2 answer
Items are available. Which method should A. Record-Triggered flows
be used to calculate the estimated ship date C. Formula field
for an Order?
C, Scheduled
A. Use a Max Roll-Up Summary field on the D. External ID field
Latest availability date fields. B. Validation Rules
Cloud kicks has a multi-screen flow that its call center agents
B. Use a CEILING formula on each of the use when handling inbound service desk calls.
C. Unvocable Actions
At one of the steps in the flow, the agents should be
Latest availability date fields. presented with a list of order numbers and dates that are
retrieved from an external order management system in real
time and displayed on the screen.
C. Use a DAYS formula on each of the What should a developer use to satisfy this requirement?
availability date fields and a COUNT Roll-Up A. An Apex REST class
Summary field on the Order.
B. An outbound message

D. Use a LATEST formula on each of the


C. An invocable method
latest availability date fields.

D. An Apex controller
A developer needs to allow users to A. Create a Custom Permission for the users.
complete a form on an Account record that
will create a record for a custom object. ● This will allow the developer to define a specific permission that can be granted only to the small group of users who
The form needs to display different fields should have access to the functionality. Custom permissions can be checked in the Lightning component or flow to
control visibility.
depending on the user's job role. The
functionality should only be available to a
small group of users. B. Create a Dynamic Form.
Which three things should the developer do
● A Dynamic Form allows for a more flexible layout and conditional visibility of fields based on user criteria. This will
to satisfy these requirements?
enable the display of different fields depending on the user’s job role, allowing for a tailored experience.
Choose 3 answers
A. Create a Custom Permission for the D. Create a Lightning web component.
users.
● A Lightning web component (LWC) can be used to create the custom form. This component can incorporate the
logic to check user roles and permissions and render fields accordingly. LWCs are also a great way to enhance user
B. Create a Dynamic Form, experience on the Lightning platform.

C. Add a Dynamic Action to the Users' Why Other Options Are Less Suitable:
assigned Page Layouts.
● C. Add a Dynamic Action to the Users' assigned Page Layouts.
○ While Dynamic Actions can be useful for controlling visibility and actions on the page, this option does not
D. Create a Lightning wet> component. directly address the requirement to create a record for a custom object or customize the fields shown
based on job roles.
● E. Add a Dynamic Action to the Account Record Page.
E. Add a Dynamic Action to the Account ○ Similar to option C, while Dynamic Actions can help manage visibility, they do not directly create the
Record Page. record or control field visibility based on job roles as effectively as a Dynamic Form and LWC.

You might also like