Platform Developer I Flashcards
A custom object has a workflow rule that updates a field when a certain set of criteria is met. A ‘before update’ Apex trigger has also been defined on the object. What will happen when a user updates a record so that it meets the criteria of the workflow rule?
Choose 1 answer.
A. An exception will be thrown due to a conflict between the two
B. Both will be fired only once
C. The Apex trigger will be fired twice
D. The Apex trigger will be fired first, voiding the Workflow Rule due to the order of execution
C. The Apex trigger will be fired twice
- According to the order of execution, ‘before’ triggers are run, ‘after’ triggers are run, and then workflow field updates are processed. If a field is updated due to a workflow rule, ‘before update’ and ‘after update’ triggers are run again one more time, and only one more time.
A developer is using debug logs to track the business processes that are run automatically in an organization. Which of the following are valid considerations for setting up a trace flag on the Platform Integration User for this use case?
Choose 2 answers.
A. A trace flag can be set on the Platform Integration User to track certain business processes that integrate internal applications.
B. Automated processes such as workflow and assignment rules can be traced using the Platform Integration User.
C. The Platform Integration User is displayed in audit fields when data is synchronized using the Salesforce Integration Cloud.
D. A trace flag can be set on the Platform Integration User to track certain processes created using the Process Builder.
A. A trace flag can be set on the Platform Integration User to track certain business processes that integrate internal applications
C. The Platform Integration User is displayed in audit fields when data is synchronized using the Salesforce Integration Cloud.
- The Platform Integration User is created automatically by Salesforce and the user detail record cannot be maintained.
- Some internal Salesforce applications automatically run their business processes as the Platform Integration User.
- The Platform Integration User shows up in audit fields in the following cases:
1) When an Einstein bot creates a case.
2) When Einstein writes prediction data to records that it is evaluating.
3) When data is synchronized using the Salesforce Integration Cloud. - Automated processes associated with the process builder, workflow rules, and assignment rules cannot be traced using a debug log by setting up a trace flag on the Platform Integration User.
An administrator is trying to send emails to certain users from a sandbox using a workflow email alert, but he has found that emails are not being sent. What action should he take?
Choose 3 answers.
A. Check the email addresses B. Check Email Deliverability setting C. Check the Email Logs D. Check the Workflow Logs E. Check the System Logs
A. Check the email addresses
B. Check Email Deliverability setting
C. Check the Email Logs
- The email deliverability setting can prevent emails from getting sent if it is set to ‘No Access’ or ‘System Email’ only.
- The Email Logs can provide information on whether the email was sent or an error was encountered in the delivery.
- Email invalidation can also prevent production users from receiving generated messages from the sandbox. When a sandbox is created or refreshed, the email address name@email.com becomes name@email.com.invalid. The administrator should check and make sure that the target users have the correct email address.
A developer would like to create a new sObject with default values using the describe information of a similar sObject. Which of the following can be used to obtain information about the type of sObject from an sObject describe result?
Choose 1 answer.
A. getSObject()
B. getType()
C. getSObjectName()
D. getSObjectType()
D. getSObjectType()
- The getSObjectType() method returns the Schema.SObjectType object for the sObject, which can be used to create a similar sObject using the newSObject() method.
Before deleting a record, a complex validation needs to be performed to confirm that the record can be deleted by querying a number of objects. What solution would be most appropriate in this situation?
Choose 1 answer.
A. Flow
B. Validation Rule
C. Apex Trigger
D. Process Builder
C. Apex Trigger
- An APEX trigger would need to be used to perform validation logic upon record deletion, and if the validation fails, stop the deletion action.
- Process Builder cannot be used on record deletion.
- A flow cannot triggered by a record deletion. It has to be triggered by something else such as a button click / link / process / apex.
What are the recommended tools for deploying metadata from one environment to another?
Choose 3 answers.
A. Visualforce Studio Code B. Ant Migration Tool C. Change Sets D. Data Loader E. Unmanaged Packages
A. Visualforce Studio Code
B. Ant Migration Tool
C. Change Sets
- Built on top of the Metadata API, the Ant Migration Tool and Salesforce Extensions for Visual Studio Code are recommended tools for migrating metadata between related or unrelated orgs
- Unmanaged Packages are intended for distributing open-source projects to developers.
- Data Loader is used for importing or exporting records and not for migrating metadata.
Which of the following are valid Apex data types?
Choose 3 answers.
A. Enum B. Blob C. Currency D. Text E. ID
A. Enum
B. Blob
E. ID
Currency and Text are not valid data types. Instead of currency and text, a developer may use Decimal and String data types respectively.
A developer is required to create a customized page that displays data from a web service callout. What controller could the developer use?
Choose 2 answers.
A. Custom
B. Standard
C. Extension
D. Standard List
A. Custom
C. Extension
- A Custom controller should be used as a controller is displaying data from a web service callout and this is not supported in standard controller actions.
- Alternately, an extension can be used if the developer will utilize standard controller actions, and use the extension for adding new actions.
A junior developer frequently experiences governor limit errors when running Apex Triggers. As a senior developer, which of the following are best practices that you could advise?
Choose 2 answers.
A. Use a combination of collections (e.g. maps, lists) and streamlined queries.
B. Use lists to perform DML operations on multiple records.
C. Use an Apex handler class for multiple triggers.
D. Use SOQL queries only within FOR loops.
A. Use a combination of collections (e.g. maps, lists) and streamlined queries.
B. Use lists to perform DML operations on multiple records.
- Utilizing lists and maps to store data obtained from queries is a fundamental technique that is used to make Apex code more efficient.
- A SOQL query can make use of the WHERE clause to query all the data required in Apex code.
- Instead of using DML statements inside FOR loops to perform operations such as insert, update, or delete on individual records, they should be executed using collections outside FOR loops.
Global Insurance has custom objects to represent policies and claims. A policy can have zero or many claims. A claim is always related to a policy. Claims are first assigned to a queue and then later assigned to different members of the claims team. What type of relationship would be used to relate the policy and claim objects?
Choose 1 answer.
A. Self relationship
B. Master-detail relationship
C. Direct relationship
D. Lookup relationship
D. Lookup relationship
- In this case, queues are required to manage and allocate claims. A queue requires an owner field, which is not available on child records in a master-detail relationship, so a lookup relationship between policy and claim would be required.
A developer working for Cosmic Solutions would like to propagate the deletion of a custom object from a developer sandbox to the production org used by the company. Which Salesforce feature or tool can be used for this requirement?
Choose 1 answer.
A. Unmanaged Package
B. Data Loader
C. Change Set
D. Ant Migration Tool
D. Ant Migration Tool
- The Force.com Migration Tool for Apache Ant can be used for propagating destructive changes from one org to another.
What is a debug level?
Choose 1 answer.
A. The debug level specifies the type of information to record in the debug log
B. The debug level specifies the amount of information to record in the debug log
C. The debug level specifies the type of user the debug log will capture information for
D. The debug level specifies the set of log levels for log categories
D. The debug level specifies the set of log levels for log categories
- A debug level is a set of log levels for debug log categories: Database, Workflow, Validation, and so on. You can reuse debug levels across your trace flags.
You are about to deploy a package from UAT environment to Production with the following components:
7 Custom Objects 43 Custom Fields 15 Validation Rules 20 Apex Classes 5 Apex Triggers
What will happen during deployment, provided that running test is set to default?
Choose 1 answer.
A. Running test classes are not required.
B. All local tests are run during the deployment.
C. All local and managed packaged tests are run during the deployment.
D. No test are run during the deployment.
B. All local tests are run during the deployment.
- For deployment to a production organization, all local tests in your organization are run by default.
- Tests that originate from installed managed packages aren’t run by default.
- If any test fails, the entire deployment is rolled back.
What method can be used to obtain metadata information about all the sObjects in an organization and their fields?
Choose 1 answer.
A. describeObjects()
B. describeSObjects()
C. getGlobalDescribe()
D. getGlobalSObjects()
C. getGlobalDescribe()
- The getGlobalDescribe() method can be used to return a map of all sObject names (keys) to sObject tokens (values) for the standard and custom objects defined in an organization.
- The describeSObjects() method can be used to obtain metadata (field list and object properties) for the specified sObject or array of sObjects.
- The sObjects need to be specified when using this method.
- There are no methods named describeObjects() and getGlobalSObjects().
Which of the following statements about delete and undelete DML operations are true?
Choose 3 answers.
A. The undelete operation does not restore the record associations for parent cases.
B. When there is a master-detail relationship, if a parent record is deleted, its children are automatically deleted.
C. Salesforce can restore lookup relationships that have been replaced.
D. Parent accounts (as specified in the Parent Account field on an account) are supported by the undelete operation.
E. Restoring all custom lookup relationships is supported by the undelete operation.
B. When there is a master-detail relationship, if a parent record is deleted, its children are automatically deleted.
D. Parent accounts (as specified in the Parent Account field on an account) are supported by the undelete operation.
E. Restoring all custom lookup relationships is supported by the undelete operation.
- Salesforce only restores lookup relationships that have not been replaced. For example, if an asset is related to a different product prior to the original product record being undeleted, that asset-product relationship is not restored.
- Cascading deletions are supported; if a parent record is deleted, its children are automatically deleted, as long as each child record can be deleted, as in case of master-detail relationships.
- The undelete operation restores the record associations for parent cases (as specified in the ‘Parent Case’ field on a case).
Which of the following statements is true about defining getter methods?
Choose 1 answer.
A. Use the name of the getter method in an expression to display the results of a getter method in a page.
B. Getter methods are suggested to include logic that increments a variable, write a log message, or add a new record to the database.
C. Every value that is calculated by a controller and displayed in a page must have a corresponding getter method
D. The [get] method is used to pass data from Visualforce page to Apex controller.
C. Every value that is calculated by a controller and displayed in a page must have a corresponding getter method
- The ‘set’ method should be used to pass data from Visualforce page to Apex controller. To pass data from an Apex controller to a Visualforce page, use the ‘get’ method.
- The name of the getter method without the ‘get’ prefix should be used to display results from a getter method.
- Also, getter methods should be designed to produce the same outcome, whether they are called once or multiple times for a single page request. It is a best practice for getter methods to be idempotent, that is, to not have side effects. For example, do not increment a variable, write a log message, or add a new record to the database. Visualforce does not define the order in which getter methods are called, or how many times they might be called in the course of processing a request.
- Getter methods return values from a controller. Every value that is calculated by a controller and displayed in a page must have a corresponding getter method, including any Boolean variables.
Project managers would like to be able to record the total amount of hours each team member works on projects. A team member can be related to multiple projects and each project can have multiple team members. How can the developer achieve this?
Choose 1 answer.
A. Create master detail relationships from a junction object ‘Project Team Member’, one to the Project object and one to the Team Member object
B. Create a master-detail relationship on Project and Team Member objects to a junction object ‘Project Team Member’.
C. Create a lookup relationship on both objects to a junction object called Project Team Member.
D. Create a master-detail relationship on the Project object to the Team Member object.
A. Create master detail relationships from a junction object ‘Project Team Member’, one to the Project object and one to the Team Member object
- In this case, as a team member can be related to multiple projects and each project can have multiple team members, a many-to-many relationship is required.
- Creating the many-to-many relationship consists of creating the junction object (e.g. Project Team Member) and creating two master-detail relationships on Project Team Member, one to Project and one to Team Member.
- When creating master-detail relationships, the relationship field is created on the detail object.
- The detail object in this case is Project Team Member.
What are reasons for using a static method or variable?
Choose 3 answers.
A. To use a method or variable without instantiating its class B. To access values of instance member variables of its class C. To store information that is shared across instances of a class D. To persist a variable value beyond the context of a single transaction E. To create a utility method in a class
A. To use a method or variable without instantiating its class C. To store information that is shared across instances of a class E. To create a utility method in a class
- Since all instances of the same class share a single copy of a static variable, it can be used to store information within the context of a transaction.
- For example, a recursive trigger can use a static variable to determine when to exit the recursion by conditionally setting its value.
- A static method can be used as a utility method and is not subject to instance member variables.
- A static method or variable is accessed without instantiating the defining class.
Static variables only persist within the context of a single transaction. Static methods cannot access values of instance member variables of its class.
An organization’s Chief Technology Officer is concerned about the use of third-party images in Visualforce pages due to recent reports from business partners about images stealing usernames and passwords. Which function can a developer use to securely fetch images that are outside an org’s server and prevent them from requesting user credentials?
Choose 1 answer.
A. HTTPS
B. IMAGEURL
C. IMAGEPROXYURL
D. URLFOR
C. IMAGEPROXYURL
- The IMAGEPROXYURL function allows secure retrieval of external images and prevents unauthorized requests for user credentials.
- It can be used on the ‘src’ attribute of a tag or the value attribute of an object.
What are some of the limitations of changing the data type of a custom field?
Choose 3 answers.
A. The file field type in Salesforce Knowledge can be changed as long as it is not referenced in a Apex Class.
B. The option to change the data type of a custom field is not available for all data types.
C. Developers cannot change the data type of a custom field if it is referenced in Apex.
D. Developers cannot change the data type of a custom field that is referenced by a Visualforce page.
B. The option to change the data type of a custom field is not available for all data types.
C. Developers cannot change the data type of a custom field if it is referenced in Apex.
D. Developers cannot change the data type of a custom field that is referenced by a Visualforce page.
- In Salesforce Knowledge article types, the file field type cannot be converted into other data types.
- The option to change the data type of a custom field is not available for all data types.
- For example, existing custom fields cannot be converted into encrypted fields nor can encrypted fields be converted into another data type. Data type of fields that are referenced by Apex Class/Visualforce page cannot be changed easily.
Sending and receiving change sets can be done between which of the following?
Choose 2 answers.
A. Developer Sandbox to Production.
B. Developer Edition to Developer Edition
C. Developer Edition to Production.
D. Sandbox to Sandbox.
A. Developer Sandbox to Production.
D. Sandbox to Sandbox.
- Change sets are not available in Developer Edition orgs.
- Change sets are available in some editions, including Enterprise and Unlimited.
A Visualforce page created by a developer needs to be added to a custom record page in Lightning Experience. However, the page uses Salesforce Classic styling which does not match the rest of the user interface. What should be done to ensure that the page uses Lightning Experience styling instead?
Choose 1 answer.
A. An option to switch to Lightning Experience styling needs to be enabled by editing the Visualforce page in Setup
B. The Visualforce page needs to be created again in Lightning Experience Setup
C. The ‘lightningStylesheets’ attribute should be set to ‘true’ in the tag
D. The tag should be used to include a custom style
C. The ‘lightningStylesheets’ attribute should be set to ‘true’ in the tag
- Using would require creating a custom style sheet as a static resource. It would also make it harder to ensure that the page styling matches that of Lightning Experience.
What trigger context variable will return true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call?
Choose 1 answer.
A. oldMap
B. isUndelete
C. isExecuting
D. isUpdate
C. isExecuting
- The isExecuting context variable returns true if any code inside trigger context is executing.
- This means you can test whether a particular trigger is executing or not by the help of this variable.
A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. For which situation would a standard list controller be sufficient? Choose 1 answer.
A. Run the Visualforce page entirely in system mode
B. Make a callout to an external web service
C. Using object record pagination.
D. Overriding existing standard functionality
C. Using object record pagination
- You can add pagination to a page using a list controller by utilizing the ‘next’ and ‘previous’ actions using a StandardListController.