Salesforce-Platform-Developer Practice Test

Salesforce Spring 25 Release -
Updated On 1-Jan-2026

237 Questions

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 (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable ( ) )

C. Use if (Schema.sObjectType.Contact.isAccessible ( ) )

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

A.   Use if (Schema, sobjectType, Contact, isUpdatable ( ) )
B.   Use if (Schema , sobjectType. Contact. Field, Is_Active_c. is Updateable ( ) )

Explanation:

To enforce object and field-level permissions before DML:

A: Checks if the user has update access to the Contact object.
B: Checks if the user has update access to the Is_Active__c field.

Why Not Others?

C: is Accessible() checks read access, not update (required for DML).
D: Ownership check does not verify CRUD/FLS permissions.

Which two settings must be defined in order to update a record of a junction object? Choose 2 answers

A. Read access on the primary relationship

B. Read/Write access on the secondary relationship

C. Read/Write access on the primary relationship

D. Read/Write access on the junction object

C.   Read/Write access on the primary relationship
D.   Read/Write access on the junction object

Explanation:

A junction object in Salesforce connects two parent objects in a many-to-many relationship. When updating records in a junction object, appropriate permissions must be set for the related records.

Read/Write access on the primary relationship is required because the junction object maintains a connection to this parent. If the user lacks write access, they cannot modify relationship links.

Read/Write access on the junction object is essential since updates are being made directly to the junction object's records. Without this, modifications would not be permitted.

Analyzing the incorrect choices:

A. Read access on the primary relationship – Read access alone is insufficient; write permissions are needed for updates.
B. Read/Write access on the secondary relationship – While this may be useful, updating the junction object itself primarily depends on permissions for the junction and primary relationship.

Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?

A. Option A

B. Option B

C. Option C

D. Option D

B.   Option B

Explanation:

To create a list button that opens a Visualforce page and allows editing of multiple records, you must use:

A Custom List Controller,

With the recordSetVar attribute on the tag.
This setup enables the Visualforce page to access multiple selected records from a list view.

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 passes because both classes and the trigger were included in the deployment.

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

C. The deployment passes because the Apex code has the required >75% code coverage.

D. The deployment fails because the Apex trigger has no code coverage.

D.   The deployment fails because the Apex trigger has no code coverage.

Explanation:

Salesforce requires that each Apex trigger is covered by at least 1% code coverage to deploy to production. In your case:

The test method directly calls MyClass.myStaticMethod, which covers the method in the class.
However, the trigger itself is not executed by the test, so the trigger has 0% coverage.
Even though the total coverage is over 75%, individual triggers must have at least some coverage (≥1%).

Universal Containers wants to automatically assign new cases to the appropriate support representative based on the case origin. They have created a custom field on the Case object to store the support representative name. What is the best solution to assign the case to the appropriate support representative?

A. Use a trigger an the Case object.

B. Use a formula field on the case object.

C. Use a validation rule on the Case object.

D. Use an Assignment Flow element.

D.   Use an Assignment Flow element.

Explanation:

Flows are powerful declarative tools that can evaluate conditions (like Case Origin) and assign values (such as setting the support rep field). This is the best and most maintainable approach for this use case.

Why the other options are not suitable:

A. Use a trigger on the Case object.
Triggers are more complex and should be used only when declarative tools like Flow can’t handle the logic.

B. Use a formula field on the Case object.
Formula fields are read-only and cannot update or assign values—they just display calculated results.

C. Use a validation rule on the Case object.
Validation rules are used to enforce data quality, not to assign or update fields automatically.

Salesforce-Platform-Developer Exam Questions - Home Previous
Page 4 out of 48 Pages