Salesforce Certified Platform Developer II Free Sample Questions

Description

Covers base system objects and localization, order of execution and Apex trigger best practices, Lightning Web Components and Visualforce, advanced testing tools, and UI and query performance.

12 free sample questions129 in the full practice test Other version: Platform Developer II(251)

Try simulator

Plat-Dev-301 Sample Questions

  1. Question 1

    Advanced

    Advanced Developer Fundamentals · Base System Objects

    A multinational financial services firm uses a custom object Transaction__c to log highly sensitive financial data. Due to regulatory requirements, visibility to these records must be strictly controlled. The sharing model is set to Private. A requirement exists where a Transaction__c record must be shared with a specific auditor user defined in a lookup field Auditor__c on the record itself, but only when the Status__c is 'Under Review'. The auditor should have Read-Only access. The sharing logic must be automated and robust against ownership changes. Which approach is the most appropriate implementation?

    Answer and explanation

    Correct answer: B

    Apex Managed Sharing is required here because Criteria-Based Sharing Rules cannot target a dynamic user defined in a lookup field on the record itself (they target Groups, Roles, etc.). Apex Managed Sharing allows the creation of a __Share record with a custom RowCause (Apex Sharing Reason), which ensures the share persists even if record ownership changes, unlike manual sharing.

  2. Question 2

    Intermediate

    Advanced Developer Fundamentals · Localization and Internationalization

    A developer is building a global application that uses Advanced Currency Management (ACM). The application includes a custom Apex calculation service that aggregates Opportunity amounts across different regions. The developer attempts to query Opportunity records and aggregate the Amount field using GROUP BY Calendar_Year(CloseDate). However, the query fails or returns incorrect currency conversions in the aggregation. What is the technical reason for this behavior?

    Answer and explanation

    Correct answer: D

    This is a specific limitation of SOQL. When Advanced Currency Management (dated exchange rates) is enabled, you cannot use the convertCurrency() function in the SELECT clause if you are also using aggregate functions (like SUM or MAX) or GROUP BY clauses. The conversion logic must be handled in Apex post-query or via a different architectural approach.

  3. Question 3

    Intermediate

    Advanced Developer Fundamentals · Base System Objects

    A logistics company uses a custom object Shipment__c with a Geolocation compound field named Delivery_Location__c. A developer needs to write an Apex trigger to identify shipments within a 10-mile radius of a warehouse. Which consideration is critical when working with this compound field in Apex?

    Answer and explanation

    Correct answer: A

    True: In Apex, you cannot access the compound field Delivery_Location__c directly as a single object. You must access its constituent fields, Delivery_Location__Latitude__s and Delivery_Location__Longitude__s, individually to perform calculations or logic. However, in SOQL, you can select the compound field directly.

  4. Question 4

    Intermediate

    Advanced Developer Fundamentals · Custom Metadata Types and Custom Settings

    A developer is architecting a solution that requires storing application configuration mappings that map external system codes to internal Salesforce record types. These mappings will be read frequently by Apex triggers but updated rarely. The mappings must be deployable via Metadata API and accessible in test classes without SeeAllData=true. Which solution is optimal?

    Answer and explanation

    Correct answer: C

    Custom Metadata Types are the optimal solution. Unlike Custom Settings, Custom Metadata records are deployable metadata (not data), meaning they move between environments via Metadata API/Change Sets. They are also visible in tests without SeeAllData=true and do not count against SOQL limits when accessed via SOQL.

  5. Question 5

    Advanced

    Advanced Developer Fundamentals · External IDs and Data Management

    A retail organization uses an external ERP system that pushes inventory updates to Salesforce nightly. The integration uses the Upsert operation on the Product2 object. The ERP uses a composite key (Manufacturer Code + SKU) to identify products. Salesforce has a custom field ERP_Key__c marked as an External ID. The integration team reports that some upserts are failing with duplicate value errors on ERP_Key__c even though the logic seems correct. What is the most likely cause?

    Answer and explanation

    Correct answer: A

    Salesforce External ID fields can be case-sensitive or case-insensitive. If the External ID is defined as case-insensitive (default for text fields unless 'Unique - Case Sensitive' is selected), Salesforce treats 'ABC-123' and 'abc-123' as duplicates. If the ERP considers these unique, the upsert will fail when attempting to insert the second record.

  6. Question 6

    Beginner

    Advanced Developer Fundamentals · Localization and Internationalization

    A developer needs to localize error messages generated in Apex for a custom component. The org supports English, French, and Spanish. The error messages must be managed by the admin team without code deployments. Which approach follows best practices?

    Answer and explanation

    Correct answer: B

    Custom Labels are the standard way to store and translate text used in Apex and Visualforce/LWC. They can be translated via the Translation Workbench and updated by admins without modifying the code.

Register free for 6 more questions

Or unlock all 129 Plat-Dev-301 questions with explanations, timed mode and flashcards.