Universal Containers wants to use a Customer Community with Customer Community Plus licenses so their customers can track how many of containers they are renting and when they are due back. Many of their customers are global companies with complex Account hierarchies, representing various departments within the same organization. One of the requirements is that certain community users within the same Account hierarchy be able to see several departments' containers, based on a junction object that relates the Contact to the various Account records that represent the departments. Which solution solves these requirements?
-
A
A Lightning web component on the Community Home Page that uses Lightning Data Services.
-
B
An Apex Trigger that creates Apex Managed Sharing records based on the junction object's relationships
-
C
A Custom List View on the junction object with filters that will show the proper records based on owner
-
D
A Visualforce page that uses a Custom Controller that specifies without sharing to expose the records
Reveal answer details
Close answer details
Correct answerB
ExplanationThe "Customer Community Plus" license is distinct because it supports advanced sharing features, including Apex Managed Sharing. In a Private sharing model, a standard community user can only see records they own or those shared with them via the role hierarchy (if applicable). Since the requirement involves granting access based on a complex relationship defined in a junction object , standard sharing rules are insufficient because they cannot "walk" the relationship of the junction object to determine access. Apex Managed Sharing (Option B) allows a developer to bridge this gap. A trigger can be written on the junction object. When a relationship is created between a Contact (Community User) and an Account (Department), the trigger can insert a record into the AccountShare table (or the share table of the container object). This share record explicitly grants the User 'Read' access to the related records. Option D is an "anti-pattern" because using without sharing to bypass security is a security risk and doesn't actually grant record access for standard platform features; it only hides the restriction within that specific page. Option A and C are UI-level solutions and do not address the underlying record-level security (sharing) required for a Private OWD model. Apex Managed Sharing provides a robust, programmatic way to enforce complex, data-driven security requirements in a Community environment.
Universal Containers needs to integrate with their own, existing, internal custom web application. The web application accepts JSON payloads, resizes product images, and sends the resized images back to Salesforce. What should the developer use to implement this integration?
-
A
A workflow rule with an outbound message that contains a session ID
-
B
An Apex trigger that calls an @future method that allows callouts
-
C
A platform event that makes a callout to the web application
-
D
A flow that calls an @future method that allows callouts
Reveal answer details
Close answer details
Correct answerB
ExplanationThis integration requirement involves two specific needs: sending a custom JSON payload and handling a response that involves updating data in Salesforce. Outbound Messaging (Option A) is a declarative tool, but it is limited to XML/SOAP protocols and cannot send JSON. Therefore, a custom programmatic solution using Apex is required to construct and send the JSON payload to the external REST service. Since the integration must be triggered by an event in Salesforce (likely the upload or update of a product record), an Apex trigger is the most direct starting point. However, as noted in previous questions, callouts cannot be performed directly within a trigger's execution context because they would block the database transaction. The developer must use asynchronous processing to handle the callout. An @future (callout=true) method is the standard way to achieve this. The trigger captures the necessary data, passes it to the future method, and the future method then performs the HTTP request to the external application. Once the external application resizes the image, it can use the Salesforce REST API to send the resized file back to Salesforce. While Platform Events (Option C) are a modern alternative for event-driven architectures, they would still require an asynchronous subscriber (like a trigger or a flow) to actually perform the callout, making the Trigger + Future method combination the most straightforward and traditional answer for this PDII scenario.
Question 3
Multiple choice
Which is a valid Apex REST Annotation? (Choose two.)
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Invokable methods accept sObjects as parameters.
-
A
-
B
Reveal answer details
Close answer details
A developer is writing unit tests for the following method: public static Boolean isFreezing(String celsiusTemp){ if(String.isNotBlank(celsiusTemp) && celsiusTemp.isNumeric()) { return Decimal.valueof(celsiusTemp) <= 0; } return null; } Which assertion would be used in a negative test case?
-
A
System.assertEquals(true, isFreezing(null))
-
B
System.assertEquals (true, isFreezing('O')
-
C
System.assertEquals(null, isFreezing('asdf))
-
D
System.assertEquals(true, isFreezingClOO'))
Reveal answer details
Close answer details
During the order of execution of a Visualforce page GET request, what happens after this step?
-
A
Evaluate constructors and expressions on custom components
-
B
Create view state if <apex: form> exists
-
C
Send the HTML response to the browser
-
D
Evaluate expressions, action attributes, and method calls
Reveal answer details
Close answer details
Within the System.Limit class, what would you call to get the total limit you can call in a single transaction?
-
A
get[typeOfLimit] --> (Ex. getDMLStatements())
-
B
getLimit [typeOfLirr.it] --> (Ex. getLin~.it DY.LSt aterr.ents ())
Reveal answer details
Close answer details
A user receives the generic "An internal server error has occurred" while interacting with a custom Lightning Component. What should the developer do to ensure a more meaningful message?
-
A
Use an AuraHandledException in a try/catch block.
-
B
Use ProcessBuilder to catch the error.
-
C
Add an onerror event handler to the tag.
-
D
Add an error-view component to the markup.
Reveal answer details
Close answer details
As part of their quoting and ordering process, a company needs to send PDFs to their document storage system's REST endpoint that supports OAuth 2.0. Each Salesforce user must be individually authenticated with the document storage system to send the PDF. What is the optimal way for a developer to implement the authentication to the REST endpoint?
-
A
Named Credential with an OAuth Authentication Provider
-
B
Hierarchy Custom Setting with a password custom field
-
C
Named Credential with Password Authentication
-
D
Hierarchy Custom Setting with an OAuth token custom field
Reveal answer details
Close answer details
Question 10
Single choice
A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.  The CalloutUtil. makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error. What should be done to address the problem?
-
A
Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
-
B
Remove the Database.setSavepoint and Database.rollback.
-
C
Move the CalloutUtil.makeRestCallout method call below the catch block.
-
D
Change the CalloutUtil.makeRestCallout to an @future method
Reveal answer details
Close answer details
Correct answerD
ExplanationSalesforce has a strict rule: You cannot perform a synchronous web service callout after performing a DML operation in the same transaction. In the provided code, the insert operations (DML) occur first, creating "uncommitted work" in the database. When the code then tries to execute makeRestCallout, the platform throws the error to prevent a long-running callout from holding database locks open. To resolve this, the callout must be moved to its own separate transaction. The most straightforward way to do this is to change the callout method to an @future(callout=true) method (Option D). When an @future method is called, the request is queued and executed in a new, independent transaction with its own governor limits. This decouples the database "work" from the external "callout." Option C is incorrect because simply moving the line doesn't change the transaction context. Option B (removing savepoints) doesn't help because the DML itself is the blocker. Option A (@InvocableMethod) is used for Flow/Process Builder and doesn't inherently solve the transaction boundary issue. Using an @future method (or a Queueable class) is the standard platform-aligned solution for this error.
Question 11
Multiple choice
Exhibit. public class LeadController { public static List<Lead> getFetchLeadList(String searchTerm, Decimal aRevenue) { String safeTerm = '%'+searchTerm.escapeSingleQuotes()+ '%'; return [ SELECT Name, Company, AnnualRevenue FROM Lead WHERE AnnualRevenue >= :aRevenue AND Company LIKE :safeTerm LIMIT 20 ]; } } A developer created a JavaScript function as part of a Lightning Web Component (LWC) that surfaces information about leads by imperatively calling getFetchLeadList when certain criteria are met. What are the changes the developer should implement in the Apex class above to ensure the LWC can display data efficiently while preserving security? (Choose three)
-
A
Annotate the Apex method with @AuraEnabled.
-
B
Annotate the Apex method with @AuraEnabled(cacheable=true).
-
C
Use the WITH SECURITY_ENFORCED clause within the SOQL query.
-
D
Implement the with sharing keyword in the class declaration.
-
E
Implement the without sharing keyword in the class declaration.
Reveal answer details
Close answer details
Correct answersB, C, D
ExplanationTo make an Apex method compatible with a Lightning Web Component's @wire service and ensure it follows security best practices, three specific modifications are required: @AuraEnabled(Cacheable=true) (Option B): The @wire service in LWC requires the Apex method to be marked as cacheable. This enables client-side caching via the Lightning Data Service, which significantly improves UI performance by reducing redundant server calls. Note that Cacheable=true is mandatory for @wire but optional for imperative calls. with sharing (Option D): In Apex, classes do not enforce sharing rules by default. To ensure the user only sees Leads they have access to according to the organization-wide defaults and sharing model, the class must explicitly use the with sharing keyword. WITH SECURITY_ENFORCED (Option C): While with sharing handles record-level access, it does not automatically enforce field-level security (FLS) or object-level security (CRUD). Adding the WITH SECURITY_ENFORCED clause to the SOQL query ensures that if a user does not have permission to view the AnnualRevenue field, the query will throw an exception rather than exposing protected data. Options A and E are incorrect because without sharing bypasses security, and a simple @AuraEnabled without cacheable=true is insufficient for the LWC @wire service.
Question 12
Single choice
What is the transaction limit for the number of records for SOSL?
-
A
-
B
-
C
100 (synchronous), 200 (async)
-
D
200 (synchronous), 100 (async)
-
E
Reveal answer details
Close answer details
Question 13
Single choice
How can a developer efficiently incorporate multiple JavaScript libraries, such as JQuery and MomenUS, in a Lightning Component?
-
A
Implement the libraries in separate helper files.
-
B
Use CONs with script attributes
-
C
Use JavaScript remoting and script tags.
-
D
Join multiple assets from a static resource.
Reveal answer details
Close answer details
Question 14
Single choice
What is a benefit of using a WSDL with Apex?
-
A
Allows for web services to be tested and achieve code coverage
-
B
Allows for classes to be imported into Salesforce
-
C
Reduces the number of callouts to third-party web services
-
D
Enables the user to not pass a Session ID where it is not necessary
Reveal answer details
Close answer details
Question 15
Single choice
Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?
-
A
use the Database.Delete method if the Contact insertion fails.
-
B
Disable validation rules on Contacts and set default values with a Trigger.
-
C
use the Database.Insert method with allOrNone set to False.
-
D
use setSavePoint() and rollback() with a try/catch block.
Reveal answer details
Close answer details
Correct answerD
ExplanationThis requirement calls for "Transactional Atomicity," meaning either both database operations (Account creation and Contact creation) succeed, or neither is committed to the database. In Apex, each DML statement normally acts as its own individual transaction unless managed by Savepoints . The correct approach is to use Database.setSavepoint() and Database.rollback() within a try-catch block (Option D) . The developer sets a savepoint immediately before the Account is inserted. If the Account is created successfully but the subsequent Contact insertion fails (due to a validation rule, trigger error, or system exception), the code enters the catch block. Within the catch block, the developer executes Database. rollback(sp), which reverts the database to the state it was in before the Account was ever inserted.
Question 16
Multiple choice
Users complain that a page Is very slow to respond. Upon investigation, the query below Is found to perform slowly. SELECT id, Name FROM Contact WHERE CustomField_c null; Which two actions can a developer take to improve performance? (Choose Two)
-
A
Add a UMir dause to the query to reduce the number of records returned.
-
B
Contact Salesforce customer support to create a custom index to include null values
-
C
Make the CustomFleld__c field an External ID.
-
D
Make the field CustomReW__c required because Salesforce field Indexes do not Include nulls.
Reveal answer details
Close answer details
Question 17
Single choice
What is the transaction limit for the number of DML statements allowed?
-
A
-
B
-
C
100 (synchronous), 200 (async)
-
D
200 (synchronous), 100 (async)
-
E
Reveal answer details
Close answer details
Correct answerE
ExplanationIncludes Approval functions, rollbacks/savepoints, and System.runAs
Question 18
Single choice
A software company uses a custom object Defect_c, to track defects in their software, Defect__c has organisation-wide defaults set to private Each Dafect__c has a related list of Reviewer_c records, each with a lookup field to User that is used to indicate that the User will review the Defect_c. What should be used to give the User on the Reviewer_c record read only access to the Defect_c record on the Reviewer_c record?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationIn a Private sharing model, access is strictly limited to owners and those granted access through specific sharing mechanisms. Here, the requirement is to grant access based on a User lookup field residing on a child record (Reviewer__c) to the parent record (Defect__c). Criteria-based sharing rules (Option D) are ineffective here because they can only evaluate fields on the record being shared (Defect__c) and cannot "look down" at values in related child records to determine access. "View All" (Option A) is too broad as it would grant the user access to every defect in the system, violating the private security model. Apex managed sharing (Option B) is the correct choice. Because the relationship between the assigned reviewer and the defect is dynamic and based on a separate object, a developer can write an Apex trigger on the Reviewer__c object. When a reviewer record is created or updated, the trigger programmatically inserts a record into the Defect__Share table, granting 'Read' access to the User specified in the lookup field. This provides the precision required to ensure that only the designated reviewers can see specific defects, maintaining the integrity of the Private OWD while automating the necessary exceptions.
Question 19
Single choice
Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs. What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?
-
A
SUM() SOQL aggregate query on the Opportunity object
-
B
SOQL for loop that counts the number of Opportunities records
-
C
COUNT() SOQL aggregate query on the Opportunity object
-
D
Apex Batch job that counts the number of Opportunity records
Reveal answer details
Close answer details
Correct answerC
ExplanationWhen you need to retrieve the total count of records in a large dataset (millions of records), a SOQL aggregate query using COUNT() (Option C) is the most efficient and performant method. Salesforce optimizes aggregate functions at the database level. Unlike a standard query that returns individual records and counts against the "50,000 SOQL rows" limit, a COUNT() query returns a single integer result and counts as only one row toward the governor limits. This allows a developer to count millions of records in a single synchronous transaction without hitting row limits or causing significant CPU time issues. Option B (SOQL for loop) is the worst approach, as it would attempt to load every individual record into memory, hitting the 50,000-row limit almost immediately and likely causing a LimitException or Request Timeout. Option D (Batch Apex) is unnecessary for a simple count and is much slower because it runs asynchronously. Option A (SUM) is used for adding up values in numeric fields, not for counting the number of records. For high-volume record counting, SELECT COUNT(Id) FROM Opportunity is the platform-standard approach to provide data to a Lightning component efficiently.
Question 20
Single choice
Refer to the markup below: HTML <template> <lightning-record-form record-id={recordId} object-api-name="Account" layout-type="Full"> </lightning-record-form> </template> A Lightning web component displays the Account name and two custom fields out of 275 that exist on the object. The custom fields are correctly declared and populated. However, the developer receives complaints that the component performs slowly. What can the developer do to improve the performance?
-
A
Replace layout-type="Full" with fields={fields}.
-
B
Add density="compact" to the component.
-
C
Replace layout-type="Full" with layout-type="Partial".
-
D
Add cache="true" to the component.
Reveal answer details
Close answer details
Correct answerA
ExplanationThe lightning-record-form is a powerful, high-level component that simplifies data entry and display. However, its performance is heavily influenced by the layout-type attribute. When layout-type="Full" is used, the component fetches and renders every single field defined on the object's "Full" page layout in the Salesforce metadata. In this case, the Account object has 275 fields. Fetching and rendering such a large volume of metadata and data causes a significant performance lag, even if the user only cares about three specific fields. To improve performance, the developer should switch from a layout-based approach to a field-based approach. By removing the layout-type attribute and adding the fields attribute (Option A), the developer can pass an array of only the specific field API names required (e.g., ['Name', 'CustomField1__c', 'CustomField2__c']). This drastically reduces the amount of data requested from the Lightning Data Service (LDS) and minimizes the DOM elements the browser needs to render. Option C is incorrect because "Partial" is not a valid value for layout-type; the only supported values are "Full" and "Compact". Option B only affects the visual spacing of the fields and does not reduce the data load. Option A is the direct and most effective way to optimize component responsiveness by limiting the data scope.
Question 21
Single choice
An org contains two custom objects: Building__c and Office__c. Office__c has a Lookup field to Building__c. A developer is asked to automatically populate the Number_of_Offices__c field on the Building__c object with the count of related Office__c records anytime an Office__c record is created or deleted. The developer cannot modify the field types. Which solution meets the requirements?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Question 22
Single choice
Refer to the code below:  When the code runs, it results In a System Limit Exception with the error message: Apex heap size too large. What should be done to fix this error?
-
A
Use a SOQL for loop to process the data.
-
B
Convert the Lis: into a 5tc.
-
C
Use Limits.getLimitHeapSize().
-
D
Use a try/catch block to catch the error.
Reveal answer details
Close answer details
Question 23
Single choice
A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time when they save a Lead record. Which best practice should the developer use to perform the validations, and allow more than one error message to be displayed simultaneously?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationWhen using lightning-record-edit-form, server-side validation rules (Option A) typically return errors one at a time as the database engine encounters them, or as a single combined toast message that can be difficult to parse. To provide a superior user experience where multiple fields are validated simultaneously before the data even reaches the server, the developer should implement Client-side validation (Option C) . In the component's JavaScript controller, the developer can intercept the onsubmit event. By iterating through all the lightning-input-field or standard lightning-input elements, the developer can programmatically check for various conditions (e.g., custom regex patterns, conditional logic between fields, or range checks). Each field can then be marked with a custom error message using the reportValidity() or setCustomValidity() methods. This allows the UI to highlight all invalid fields at once, providing immediate, comprehensive feedback to the user. This approach reduces unnecessary server round-trips and ensures that the user can correct all issues in a single pass before successfully submitting the record.
Question 24
Single choice
A developer must perform a complex SOQL query that joins two objects in a Lightning component. How can the Lightning component execute the query?
-
A
Use the SaJesforce Streaming API to perform the SOQL query.
-
B
Create a Process Builder to execute the query and invoke from the Lightning component.
-
C
Invoke an Apex dass with the method annotated as iraEnabled to perform the query.
-
D
Write the query in a custom Lightning web component wrapper and invoke from the Lightning component.
Reveal answer details
Close answer details
Question 25
Single choice
What is a potential design issue with the following code? trigger AccountTrigger on Account (before update) { Boolean processOpportunity = false; List<Opportunity> opptysClosedLost = new List<Opportunity>(); List<Opportunity> lstAllOpp = [ SELECT StageName FROM Opportunity WHERE AccountId IN :Trigger.newMap.keySet() ]; if (!lstAllOpp.isEmpty()) { processOpportunity = true; } while (processOpportunity) { for (Opportunity o : lstAllOpp) { if (o.StageName == 'Closed - Lost') { opptysClosedLost.add(o); } } processOpportunity = false; if (!opptysClosedLost.isEmpty()) { delete opptysClosedLost; } } }
-
A
SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity
-
B
The code will result in a System.LimitException: Too many script statements error
-
C
The code will result in a System.DmlException: Entity is deleted error
-
D
The code will result in a System.LimitException: Apex CPU time limit exceeded error
Reveal answer details
Close answer details
Question 26
Single choice
A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set. What is the optimal way to achieve this?
-
A
Create a Before Save Flow, execute a Queueable job from it, and make a callout from the Queueable job.
-
B
Create an Apex class, execute a Batch Apex job from it, and make a callout from the Batch Apex job.
-
C
Create an Apex trigger, execute a Queueable job from it, and make a callout from the Queueable job.
-
D
Create an Apex class, execute a Future method from it, and make a callout from the Future method.
Reveal answer details
Close answer details
Correct answerC
ExplanationThe requirement is to perform a callout when a record is inserted. Because Salesforce prohibits synchronous callouts after DML operations in the same transaction, this must be handled asynchronously. Queueable Apex (Option C) is the optimal choice for this integration. When an Account is inserted, a trigger captures the ID and enqueues a Queueable job. Queueable is superior to Future methods (Option D) because it supports complex data types (not just primitives), allows for job chaining, and provides a Job ID that can be used for monitoring via AsyncApexJob. Before-Save Flows (Option A) cannot directly perform callouts, and while they can trigger asynchronous paths, the programmatic control offered by a Trigger-to-Queueable pattern is more robust for complex third-party integrations. Batch Apex (Option B) is designed for bulk processing of existing records and is "overkill" for a real-time, record-by-record trigger requirement. By using a Trigger with Queueable, the developer ensures the address validation happens nearly in real-time without blocking the user's initial save transaction or hitting concurrent request limits.
Question 27
Multiple choice
A developer is creating a page in App Builder that will be used in the Salesforce mobile app. Which two practices should the developer follow to ensure the page operates with optimal performance? (Choose Two)
-
A
Limit five visible components on the page.
-
B
Limit 25 fields on the record detail page.
-
C
Limit the number of Tabs and Accordion components.
-
D
Analyze the page with Performance Analysis for App Builder.
Reveal answer details
Close answer details
Question 28
Multiple choice
Which two queries are selective SOQL queries and can be used for a large data set of 200,000 Account records? (Choose Two)
-
A
SELECT Id FROM Account WHERE Name != ''
-
B
SELECT Id FROM Account WHERE Name = NULL
-
C
SELECT Id FROM Account WHERE Name = NULL AND Customer_Number__c = 'ValueA'
-
D
SELECT Id FROM Account WHERE Id IN :listOfAccountIds
Reveal answer details
Close answer details
Question 29
Single choice
A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses. Which tool should the developer use?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Question 30
Single choice
A developer is asked to find a way to store secret data with an ability to specify which profiles and users can access which secrets. What should be used to store this data?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationWhen a requirement involves storing configuration or "secret" data that needs to vary based on the specific user or profile, Hierarchy Custom Settings (Option B) are the correct choice. Unlike Custom Metadata (Option C), which is available to the entire organization regardless of the user, Hierarchy Custom Settings use a built-in logic to provide values based on the "most specific" level defined. The hierarchy follows a specific order: User > Profile > Organization. If a secret key is defined at the User level, that value is returned for that specific user. If not, the system looks for a value defined at the user's Profile level, and finally falls back to the Organization-wide default. This allows a developer to store sensitive keys or flags and restrict or vary them dynamically based on the current user's identity. Custom Metadata is better suited for application-wide configurations that need to be deployable via packages, but it lacks the granular per-user/per-profile override capability inherent to Hierarchy Custom Settings. Static Resources (Option A) are public to anyone with access to the resource, and Cookies (Option D) are stored on the client side, making them insecure for "secret" data. Therefore, Custom Settings provide the best balance of security and hierarchical flexibility for this use case.
Question 31
Single choice
Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving m Account. How can a developer fix this error?
-
A
Split the trigger logic into two separate triggers.
-
B
Modify the trigger to use the isMultiThread=true annotation.
-
C
Convert trigger to use the uture annotation, and chain any subsequent trigger invocations to the Account object.
-
D
Use a helper class to set a Boolean to TRUE the first time a trigger is fired, and then; modify the trigger to only fire when modify the trigger to only fire when the Boolean is FALSE.
Reveal answer details
Close answer details
Correct answerD
ExplanationThe "Maximum trigger depth exceeded" error occurs when a recursive loop is created, causing triggers to fire repeatedly until the platform's limit of 16 recursive calls is reached. This often happens when an after update trigger performs a DML operation on the same record that initiated the trigger, or when two different objects have triggers that update each other in a circular fashion. To resolve this, developers use a static Boolean variable within a helper class to manage the execution state. Because static variables in Apex persist for the duration of a single transaction, the trigger can check the value of this Boolean before executing its logic. When the trigger runs for the first time, it checks if the Boolean is FALSE, sets it to TRUE, and then proceeds. If the trigger is re-invoked within the same transaction (recursion), the Boolean check will fail, and the logic will be skipped. This "recursion guard" ensures the logic only runs once per transaction. Splitting the logic into two triggers (Option A) would not help, as both triggers would still be part of the same recursive cycle. There is no isMultiThread annotation (Option B), and while @future (Option C) can break the immediate execution chain, it does not address the underlying logic flaw and can lead to unmanageable asynchronous overhead. The static variable approach is the industry-standard "best practice" for recursion control.
Question 32
Single choice
A company uses Salesforce to sell products to customers. They also have an external product information management (PIM) system that is the system of record for products. A developer received these requirements: Whenever a product is created or updated in the PIM, a product must be created or updated as a Product2 record in Salesforce and a PricebookEntry record must be created or updated automatically by Salesforce. The PricebookEntry should be created In a Pricebook2 that is specified In a custom setting. What should the developer use to satisfy these requirements?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
ExplanationThis requirement involves a complex, multi-step integration where an external system (PIM) drives data changes in Salesforce across multiple objects (Product2 and PricebookEntry) and requires a lookup to a specific configuration (Custom Setting). While the standard Salesforce REST API can create records, it would require the PIM to manage the sequencing and the lookup logic for the Pricebook. A Custom Apex REST (Option A) service is the optimal solution because it allows the developer to expose a single endpoint to the PIM. The PIM can send a single JSON payload representing the product. The Apex code then takes over to: Upsert the Product2 record based on an External ID. Retrieve the Pricebook2 ID from the Custom Setting. Query and upsert the corresponding PricebookEntry record. This "wraps" the entire business process into a single transaction, ensuring data integrity (either both records are updated, or neither is) and reducing the number of round-trips the external system must make. Option D is for creating trees of records but doesn't easily support the logic of checking custom settings or existing records for upserting. Option C is for Flow/Process Builder, and Option B is for security auditing. Custom Apex REST provides the necessary flexibility for complex cross-object integration logic.
Question 33
Single choice
What is the optimal technique a developer should use to programmatically retrieve Global Picklist options in a Test Method?
-
A
Perform a callout to the Metadata API.
-
B
Use the Schema namespace.
-
C
-
D
Reveal answer details
Close answer details
Question 34
Multiple choice
Where in a query can you use Geolocation and Distance? (Choose two.)
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Question 35
Single choice
Users report that a button on a custom Lightning Web Component is not working. However, there are no other details provided. What should the developer use to ensure error messages are properly displayed?
-
A
Add the <apex:messages/> tag to the component.
-
B
Use the Database method with allOrNone set to false.
-
C
Add a Try/Catch block surrounding the DML statement.
-
D
Add JavaScript and HTML to display an error message.
Reveal answer details
Close answer details
Question 36
Single choice
A developer is writing a complex application involving triggers, workflow rules, Apex classes, and processes. The developer needs to carefully consider the order of execution when developing the application. 1. Before Triggers 2. After Triggers 3. Post commit logic such as sending email 4. DML committed to the database 5. Workflow rules 6. Roll-up summary calculations In what order do the following operations execute?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Question 37
Single choice
A lead developer is creating tests for a Lightning web component. The component re-renders when a property called bypassSelection changes its value. What should the developer use to test that the component re-renders successfully when the property changes?
-
A
-
B
-
C
dispatchEvent (new CustomEvent(`bypassSelection'))
-
D
Reveal answer details
Close answer details
Question 38
Multiple choice
Which of the following standard fields are indexed? (Choose three.)
-
A
-
B
-
C
-
D
-
E
Reveal answer details
Close answer details
Question 39
Single choice
A company uses Opportunism to track sales to their customers and their org has millions of Opportunities. They want to begging to track revenue over time through a related Revenue object. As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic. They estimate that roughly 100,000 Opportunities will have revenue records and populated. What is the optimal way to automate this?
-
A
Use System.enqueueJob>() to Invoke a Queueable class.
-
B
Use System.scheduleJob() to schedule a Database.Scheduleable class.
-
C
Use Database.executeBatch() to invoke a Queueable dass.
-
D
Use Database.executeBatch() to invoke a Database.Batchable class.
Reveal answer details
Close answer details
Correct answerD
ExplanationFor high-volume data processing (such as seeding 100,000 records) involving complex logic, Batch Apex (Option D) is the standard and most robust solution. Batch Apex is designed to handle up to 50 million records by breaking the total set into smaller, manageable chunks (defaulting to 200 records per batch). Each batch execution gets its own set of governor limits. This is crucial for "complex logic," as it prevents the transaction from hitting CPU time or heap size limits that would occur if one tried to process all 100,000 records in a single synchronous transaction. Batch Apex also provides built-in state management and error handling (via Database.RaisesPlatformEvents or the finish method). Option A (Queueable) is better suited for smaller, chained tasks; while it can handle some volume, it is not optimized for 100,000 records in the same way the QueryLocator in Batch Apex is. Option C is a syntactical impossibility as executeBatch only accepts Batchable classes. Option B (Schedulable) is used for timing, but the actual heavy lifting for 100,000 records would still need to be handed off to a Batch class to avoid timeout errors. Therefore, Database.Batchable is the optimal tool for large-scale data seeding.
Question 40
Multiple choice
Which of the follow be used together in DML operations (transaction)? (Choose two.)
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Question 41
Single choice
Consider the following code snippet: HTML <c-selected-order> <template for:each={orders.data} for:item="order"><c-order orderId={order.Id}></c-order></template> </c-selected-order> How should <c-order> component communicate to the <c-order-order> component that an order has been selected by the user?
-
A
Created and fire an application event.
-
B
Create and fire a standard DOM event.
-
C
Create and fire a component event.
-
D
Create and dispatch a custom event
Reveal answer details
Close answer details
Correct answerD
ExplanationIn Lightning Web Components (LWC), components communicate up the containment hierarchy (from child to parent) by creating and dispatching Custom Events. Unlike the older Aura framework, which used specific "Component" or "Application" event types (Options A and C), LWC relies on standard web browser event protocols. The child component (c-order) would instantiate a CustomEvent object, optionally including a data payload in the detail property (such as the orderId), and then call the this.dispatchEvent() method. The parent component (c-selected-order) then listens for this event using an on prefix (e.g., onselection= {handleSelection}) in its HTML template. While you could technically use a standard DOM event (Option B), the CustomEvent interface is the platform-standard best practice in LWC for passing custom data payloads between components. Custom events allow for clean encapsulation and follow the modern "Events Up, Properties Down" design pattern common in reactive frameworks like LWC, React, and Vue.
Question 42
Single choice
If the "PageReference.setRedirect" Apex function is set to True, what type of request is made?
-
A
-
B
-
C
If PageReference points to the same controller and subset of extensions, postback request, otherwise get request
Reveal answer details
Close answer details
Question 43
Single choice
A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.  When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry. What is the optimal way to implement this?
-
A
Add an <apex: actionFunction> within the <apex : selectOptions>.
-
B
Add an <apex: actionFunction> within the <apex: select List >.
-
C
Add an <apex: actionSupport> within the <apex:selectList>.
-
D
Add an <apex: actionSupport> within the <apex: selectOptions>.
Reveal answer details
Close answer details
Question 44
Single choice
What is the transaction limit on the number of Apex jobs added to the queue?
-
A
-
B
-
C
-
D
-
E
Reveal answer details
Close answer details
Question 45
Multiple choice
A developer needs test data for Apex test classes. What can the developer use to provide test data to the test methods? (Choose two.)
-
A
List<sObject> Is = Test.loadData (Lead.sObjectType, fmyTestLeads f);
-
B
myDataFactory.createTestRecords (10)
-
C
Database.createTestRecords (10)
-
D
List<sObject> Is = Test.loadDat (Lead.sObjectType, $Resource + 'myTestLeads f);
Reveal answer details
Close answer details
Question 46
Single choice
Universal Containers wants to notify an external system, in the event that an unhandled exception occurs, by publishing a custom event using Apex. What is the appropriate publish/subscribe logic to meet this requirement?
-
A
Publish the error event using the EventBus.publish() method and have the external system subscribe to the event using CometD.
-
B
Publish the error event using the addError() method and have the external system subscribe to the event using CometD.
-
C
Publish the error event using the addError() method and write a trigger to subscribe to the event and notify the external system.
-
D
Have the external system subscribe to the event channel. No publishing is necessary.
Reveal answer details
Close answer details
Correct answerA
ExplanationPlatform Events provide a powerful way to integrate Salesforce with external systems using an event-driven architecture. To meet the requirement of notifying an external system about an exception, the developer must first define a Custom Platform Event (e.g., Error_Event__e). In the Apex code, specifically within a catch block, the developer should instantiate this event and publish it using the EventBus.publish() method ( Option A ). Once published, the event is placed on the event bus. External systems can listen for these events by subscribing to the event channel. The standard protocol for external clients to subscribe to Salesforce Platform Events is CometD , an implementation of the Bayeux protocol that allows for long-polling and real-time push notifications. Option B and C are incorrect because addError() is a method used in triggers or Visualforce to display a validation error message to the UI and roll back the transaction; it is not used for publishing Platform Events. Option D is incorrect because an external system cannot receive an event unless the Salesforce application explicitly publishes it to the bus. Using EventBus.publish() with a CometD subscriber provides a robust, decoupled integration pattern for real-time error reporting.
Question 47
Single choice
A developer is integrating with a legacy on-premise SQL database. What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Question 48
Single choice
MyOpportunities.js import { LightningElement, api, wire } from 'lwc'; import getOpportunities from '@salesforce/apex/OpportunityController.findMyOpportunities'; export default class MyOpportunities extends LightningElement { @api userId; @wire(getOpportunities, { oppOwner: '$userId' }) opportunities; } OpportunityController.cls public with sharing class OpportunityController { @AuraEnabled public static List<Opportunity> findMyOpportunities(Id oppOwner) { return [ SELECT Id, Name, StageName, Amount FROM Opportunity WHERE OwnerId = :oppOwner ]; } } A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: "Error retrieving data". Which action must be completed in the Apex method to make it wireable?
-
A
Use the Continuation=true attribute in the Apex method.
-
B
Edit the code to use the without sharing keyword in the Apex class.
-
C
Use the cacheable=true attribute in the Apex method.
-
D
Ensure the OWD for the Opportunity object is Public.
Reveal answer details
Close answer details
Correct answerC
ExplanationTo use the @wire service in a Lightning Web Component (LWC) to retrieve data from an Apex method, the Apex method must be marked as cacheable. In the provided OpportunityController class, the findMyOpportunities method is annotated with @AuraEnabled, but it lacks the mandatory cacheable=true property. The @wire service is part of the Lightning Data Service (LDS) reactive framework. Salesforce requires wireable Apex methods to be cacheable to improve performance and ensure that data can be stored in the client-side cache. Without cacheable=true, the @wire decorator fails to execute, resulting in the "Error retrieving data" message or a similar runtime failure. Option C is the correct fix: the developer must update the annotation to @AuraEnabled(cacheable=true). Option A (Continuation) is only used for long-running external callouts. Option B (without sharing) may affect record visibility but is not a requirement for wireable methods. Option D (OWD settings) affects data access but does not resolve the technical requirement for using @wire. Once marked as cacheable, Lightning Data Service can properly manage the data lifecycle for the component.
Question 49
Single choice
Universal Containers develops a Visualforce page that requires the inclusion of external JavaScript and CSS files. They want to ensure efficient loading and caching of the page. Which feature should be utilized to achieve this goal?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
ExplanationTo optimize the performance of a Visualforce page that uses external assets, Static Resources (Option A) is the platform-native best practice. Static resources allow you to upload content such as archives (.zip or .jar files), images, stylesheets, and JavaScript files that you can reference in a Visualforce page. The primary benefits of using Static Resources over other methods (like hosting files externally or hardcoding styles) include: Caching: Salesforce serves static resources from a Content Delivery Network (CDN). This means once a user's browser loads the JavaScript or CSS file, it is cached locally, significantly reducing page load times for subsequent requests. Relative Referencing: Using the $Resource global variable (e.g., {!URLFOR($Resource.MyZipFile, 'styles/ main.css')}) ensures that your page references the correct version of the file across different environments (Sandbox, Production) without changing hardcoded URLs. Efficiency: By bundling related files into a single ZIP archive as a static resource, you reduce the number of HTTP requests the browser must make to render the page. Options B and D are related to AJAX and JavaScript-to-Apex communication, and Option C is a component used for rendering data tables; none of these address the storage or caching of external front- end assets.
Question 50
Single choice
A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes. Which tool or mechanism should be utilized for managing the source-driven deployment process?
-
A
-
B
-
C
Salesforce CLI with Salesforce DX
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationSource-driven development shifts the "source of truth" from the Salesforce Org to a Version Control System (like Git). To bridge the gap between local source code and the Salesforce platform, Salesforce CLI with Salesforce DX (Option C) is the required mechanism. Salesforce DX (Developer Experience) introduced a source-centric metadata format that is more granular and easier to track in version control than the traditional Metadata API. The Salesforce CLI provides the command-line tools necessary to automate the deployment process, create scratch orgs for isolated testing, and perform "source tracking" to identify exactly which files have changed. This is the foundation of modern CI/CD (Continuous Integration/Continuous Delivery) pipelines in the Salesforce ecosystem. In contrast, Change Sets (Option B) are org-centric and manual, making them incompatible with automated version control. Data Loader (Option A) is for record data, not metadata. Unmanaged Packages (Option D) are used for distribution but do not support the iterative, source-controlled deployment workflow required for professional project management.
Question 51
Single choice
UC Loans is a small company with a part time Salesforce administrator. UC Loans wants to create a Loan__c record whenever an Opportunity is won. What is the optimal solution for UC Loans to accomplish this?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Question 52
Multiple choice
A developer writes the following code:  While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)
-
A
Use the asyncSend() method of the HTTP class to send the request in async context
-
B
Ensure all callouts are completed prior to executing DML statements
-
C
Move the web service callout into an @future method
-
D
Use Database.insert (order, true) to immediately commit any database changes
Reveal answer details
Close answer details
Question 53
Single choice
A developer must create a way for external partners to submit millions of leads into Salesforce per day. How should the developer meet this requirement?
-
A
Publicly expose a Visualforce page via Force.com Sites
-
B
Create a web service on Heroku that uses Heroku Connect
-
C
Host a Web-to-Lead form on the company website
-
D
Publicly expose an Apex Web Service via Force.com Sites
Reveal answer details
Close answer details
Question 54
Single choice
Which of the following object types can be used with a Web Service?
-
A
-
B
-
C
-
D
-
E
-
F
Reveal answer details
Close answer details
Question 55
Single choice
A lead developer for a Salesforce organization needs to develop a page-centric application that allows the user to interact with multiple objects related to a Contact. The application needs to implement a third-party JavaScript framework such as Angular, and must be made available in both Classic and Lightning Experience. Given these requirements, what is the recommended solution to develop the application?
-
A
-
B
-
C
-
D
Lightning Experience Builder
Reveal answer details
Close answer details
Question 56
Single choice
An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved. What is the optimal way to implement this?
-
A
Apex trigger on Account that calls the Contact trigger to normalize the address
-
B
Apex trigger on Contact that calls the Account trigger to normalize the address
-
C
Apex trigger on Account that and Account that normalized the address
-
D
Apex trigger on Account and Account that call a helper class to normalize the address
Reveal answer details
Close answer details
Correct answerB
ExplanationIn software engineering, the DRY (Don't Repeat Yourself) principle is fundamental for maintainability. If the logic for normalizing an address is identical for both Accounts and Contacts, that logic should not be duplicated across two separate trigger files. The optimal implementation (Option D) is to create a single Trigger Helper or Utility class . This class contains a static method (e.g., AddressService.normalize(List<sObject> records)) that performs the normalization logic. You then create a small trigger on the Account object and a small trigger on the Contact object, both of which simply invoke this shared helper method. This approach offers several advantages: Maintainability: If the company standard for addresses changes (e.g., changing "St." to "Street"), the developer only needs to update the code in one place . Reusability: The helper method can also be called from other contexts, such as an Anonymous Apex script or a Batch job. Readability: Triggers remain "thin" and easy to read, acting only as entry points rather than containing complex business logic. Options A and B are technically impossible; a trigger on one object cannot "call" a trigger on another object directly. Option C is less optimal because it leads to code duplication and a higher risk of bugs when logic is updated in one trigger but forgotten in the other.
Question 57
Multiple choice
A company recently deployed a Visualforce page with a custom controller that has a data grid of information about Opportunities in the org. Users report that they receive a "Maximum view state size limit" error message under certain conditions. According to Visualforce best practice, which three actions should the developer take to reduce the view state? (Choose three.)
-
A
Use the transient keyword in the Apex controller for variables that do not maintain state
-
B
Use the final keyword in the controller for variables that will not change
-
C
Use the private keyword in the controller for variables
-
D
Refine any SOQL queries to return only data relevant to the page
-
E
Use filters and pagination to reduce the amount of data
Reveal answer details
Close answer details
Correct answersA, D, E
ExplanationThe Visualforce View State holds the state of the page (including controller variables) between server requests. It has a strict limit of 135KB. When a page handles large sets of data, like a grid of Opportunities, the view state can easily exceed this limit. Transient Keyword (Option A): This is the most effective programmatic way to reduce view state. Marking a variable as transient prevents it from being serialized into the view state. This should be used for any data that is only needed for the current request and does not need to be maintained during a postback (e.g., large lists of records retrieved for a single display). Filters and Pagination (Option E): By using a StandardSetController or custom offset logic, the developer can limit the number of records held in memory at any given time. Instead of loading 5,000 Opportunities, the page can load and store only 20 records per page. Refine SOQL Queries (Option D): Developers often query "all" fields (e.g., SELECT * equivalent) or include large text areas that aren't displayed. By selecting only the specific fields required for the grid, the size of each object in the collection is reduced, directly lowering the view state. Option B and C (private and final) affect variable visibility and immutability but do not prevent the variables from being serialized into the view state.
Question 58
Single choice
A developer has working business logic code, but sees the following error in the test class: "You have uncommitted work pending. Please commit or rollback before calling out." What is a possible solution?
-
A
Rewrite the business logic and test classes with @TestVisible set on the callout.
-
B
Set seeAllData=true at the top of the test class, since the code does not fail in practice.
-
C
Call support for help with the target endpoint, as it is likely an external code error.
-
D
Use Test.isRunningTest() before making the callout to bypass it in test execution.
Reveal answer details
Close answer details
Question 59
Single choice
A developer is writing a Jest for a Lightning web component that conditionally displays child components based on a user's checkbox selections. What should the developer do to property test that the correct components display and hide for each scenario?
-
A
Reset the DOM after each test with the afterEach() method.
-
B
Add a teardown block to reset the DOM after each test.
-
C
Create a new describe block for each test
-
D
Create a new j.sdom instance for each test.
Reveal answer details
Close answer details
Correct answerA
ExplanationJest tests for Lightning Web Components (LWC) run in a virtual browser environment called JSDOM. In this environment, the document.body persists across individual test cases (it or test blocks) within a single test file. If a developer mounts a component to the DOM in the first test and doesn't remove it, the component's state and DOM elements will still be present when the second test starts, leading to "leaked" data and unreliable test results. To ensure test isolation--which is critical for testing conditional rendering--the developer must clean up the DOM after every test. The standard best practice is to use the afterEach() hook ( Option A ). Within this hook, the developer should execute a loop that removes all child elements from document.body. This ensures that each test begins with a completely "clean slate." Option B is too vague; "teardown block" is a general term, but afterEach() is the specific Jest implementation. Option C is for organizing tests but doesn't handle DOM cleanup. Option D is unnecessary as the LWC testing utility manages the JSDOM instance. By using afterEach() to reset the DOM, the developer can accurately verify that the component correctly shows or hides child components based on the specific inputs provided in each individual test case.
Question 60
Single choice
Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
-
A
Database.insert(records, false)
-
B
Database.insert(records, true)
-
C
-
D
Reveal answer details
Close answer details
Question 61
Single choice
Which type of controller is best suited when you want to add custom functionality to a standard controller page, or when you want reusable functionality throughout pages?
-
A
-
B
Standard List/Set Controller
-
C
-
D
Reveal answer details
Close answer details
Question 62
Multiple choice
A developer is building a Visualforce page that interacts with external services. Which interface should the developer implement to test this functionality? (Choose two.)
-
A
-
B
-
C
-
D
StaticResourceCalloutMock
Reveal answer details
Close answer details
Question 63
Single choice
A developer created the following test method: @isTest(SeeAllData= true) public static void testDeleteTrigger(){ Account testAccount = new Account(name = 'Test1'); insert testAccount; List<Account> testAccounts = [SELECT Id, Name from Account WHERE Name like 'Test%']; System.assert(testAccounts.size() > 0); delete testAccounts; testAccounts = [SELECT Id, Name from Account WHERE Name like 'Test%']; System.assert(testAccounts.size() == 0); } The developer org has five accounts where the name starts with Test". The developer executes this test in the Developer Console. After the test code runs, which statement is true?
-
A
-
B
There will be no accounts where the name starts with "Test".
-
C
There will be five accounts where the name starts with Test".
-
D
There will be six accounts where the name starts with Test".
Reveal answer details
Close answer details
Correct answerC
ExplanationEvery Apex test execution is treated as a temporary transaction. One of the most critical aspects of this execution is that any changes made to the database--including the insertion, modification, or deletion of records--are automatically rolled back at the end of the test run. This mechanism ensures that unit tests do not leave behind "garbage" data or alter the state of the organization's actual business data, maintaining a consistent environment for development and production. In this specific scenario, the @isTest(SeeAllData=true) annotation is used, which allows the test method to view existing data in the organization. Because the org already contains five accounts starting with "Test," the test method sees them. When the test code inserts a new account named "Test1," the count within that specific transaction becomes six. The subsequent code queries for these six accounts and deletes them. While the test is running, the deletion is successful, which is why the assertion checking for zero accounts passes. However, once the test finishes, the entire transaction is rolled back. The rollback effectively "undoes" the deletion of the original five accounts and the creation of the one new account. Consequently, the organization returns to its exact state from before the test was initiated. The five original accounts remain in the database as if the test never occurred, making option C the correct answer.
Question 64
Single choice
An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed end Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance. When a test batch of records are loaded, the Apex trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created. What is the most extendable way to update the Apex trigger to accomplish this?
-
A
Use a List Custom Setting to disable the trigger for the user who loads the data.
-
B
Add a Validation Rule to the Contract to prevent Contract creation by the user who loads the data.
-
C
Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.
-
D
Add the Profile ID of the user who loads the data to the trigger so the trigger will not fire for this user.
Reveal answer details
Close answer details
Correct answerC
ExplanationWhen managing trigger logic that needs to be conditionally bypassed (often called a "Trigger Kill Switch"), using Hierarchy Custom Settings (Option C) is the best practice for scalability and maintainability. A developer can create a Hierarchy Custom Setting named Trigger_Settings__c with a checkbox field Disable_Opportunity_Trigger__c. In the Apex trigger, the code should first check this setting: if (Trigger_Settings__c.getInstance().Disable_Opportunity_Trigger__c) return; Because it is a hierarchy setting, an administrator can enable this checkbox specifically for the User or Profile performing the data load without affecting the daily operations of other sales reps. Once the data load is complete, the setting can be toggled off. This approach is "extendable" because it doesn't require hardcoding IDs (Option D), which change between environments (Sandbox vs. Production). Option A (List Custom Settings) is less flexible because it doesn't support the Profile-to-User hierarchy. Option B (Validation Rules) would stop the record creation but would result in a DML error in the trigger, potentially failing the entire data load transaction rather than simply skipping the logic. Hierarchy Custom Settings provide a clean, metadata-driven way to control execution flow across different user contexts.
Question 65
Single choice
A managed package uses a list of country ISO codes and country names as reference data in many different places from within the managed package Apex code. What is the optimal way to store and retrieve the list?
-
A
Store the information in Custom Metadata and query it with SOQL.
-
B
Store the information in Custom Metadata and access it with the getAll() method.
-
C
Store the information in a List Custom Setting and query it with SOQL.
-
D
Store the information in a List Custom Setting and access it with the getAll() method
Reveal answer details
Close answer details
Correct answerD
ExplanationReferences: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/ apex_customsettings.htm
Question 66
Multiple choice
What is a valid request for the following REST method? (Choose two.) global static void myPostMethod(String s1, Integer i1, Boolean b1, String s2)
-
A
<request> <s1>my first string</s1> <i1>123</i1> <s2>my second string</s2> <b1>false</b1> </request>
-
B
<request> <s1>"my first string"</s1> <i1>123</i1> <s2>"my second string"</s2> <b1>false</b1> </request>
-
C
{ "s1": "my first string", "i1": "123", "b1": "false", "s2": "my second string" }
-
D
{ "i1": 123, "s1": "my first string", "s2": "my second string", "b1": false }
Reveal answer details
Close answer details
Question 67
Single choice
The maximum view state size of a visualforce page is______________.
-
A
-
B
-
C
-
D
-
E
Reveal answer details
Close answer details
|