Plat-Dev-301 Salesforce Certified Platform Developer II Practice Questions
Prepare for Plat-Dev-301 with more than an answer.
Unlock the full exam and previous versions
- v1Salesforce Certified Platform Developer II 129 questions Current
- Platform Developer IILegacy Salesforce Certified Platform Developer II 251 questions Locked
- Exam fee
- $200 USD
- Level
- Advanced
- Valid for
- Ongoing with annual maintenance releases
Domains covered on the exam 5
- Advanced Developer Fundamentals15%
- Process Automation, Logic, and Integration27%
- User Interface20%
- Testing, Debugging, and Deployment20%
- Performance18%
- 1
A developer uses the following command to make a callout to an external system:
HttpRequest req = new HttpRequest();req.setEndpoint('callout:My_Creds/some_path');What must be configured in Salesforce for this code to function?
Show answer details
Correct answer: D
The syntax
callout:My_Credsspecifically references a Named Credential with the API Name 'My_Creds'. - 2
A developer creates a Platform Event
Order_Event__eto decouple the order processing logic. An external system publishes events to this bus, and an Apex Trigger subscribes to it.Which statement accurately describes the behavior of the Apex Trigger for Platform Events?
Show answer details
Correct answer: A
Platform Event triggers are asynchronous and decoupled from the publishing transaction. Salesforce batches events for the trigger, and
Trigger.newcan contain up to 2,000 records (unlike the standard 200 for object triggers). - 3
A developer executes the following SOQL query in Apex:
AggregateResult[] results = [SELECT AccountId, SUM(Amount) Total FROM Opportunity GROUP BY AccountId];How should the developer retrieve the 'Total' value from the first result?
Show answer details
Correct answer: A
AggregateResult objects behave like maps. You must use the
.get('Alias')method to retrieve values. SinceSUMreturns a number, it must be cast to Decimal (or Double/Integer depending on need, but Decimal is safest for currency). - 4
A multinational financial services firm uses a custom object
Transaction__cto 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 aTransaction__crecord must be shared with a specific auditor user defined in a lookup fieldAuditor__con the record itself, but only when theStatus__cis '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?Show answer details
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
__Sharerecord with a customRowCause(Apex Sharing Reason), which ensures the share persists even if record ownership changes, unlike manual sharing. - 5
A developer is building a global application that uses Advanced Currency Management (ACM). The application includes a custom Apex calculation service that aggregates
Opportunityamounts across different regions. The developer attempts to queryOpportunityrecords and aggregate theAmountfield usingGROUP BY Calendar_Year(CloseDate). However, the query fails or returns incorrect currency conversions in the aggregation. What is the technical reason for this behavior?Show answer details
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. - 6
A logistics company uses a custom object
Shipment__cwith aGeolocationcompound field namedDelivery_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?Show answer details
Correct answer: A
True: In Apex, you cannot access the compound field
Delivery_Location__cdirectly as a single object. You must access its constituent fields,Delivery_Location__Latitude__sandDelivery_Location__Longitude__s, individually to perform calculations or logic. However, in SOQL, you can select the compound field directly.
