Salesforce PD1 Questions Flashcards
How is Model-View-Controller (MVC) architecture implemented on the Salesforceplatform?
Model: Standard and Custom Objects; View: Visualforce Pages; Controller: ApexCode
What are two sets of code that represent the Controller in MVC architecture on the Force.com platform?
- Standard Controllersystem methods that are referenced by Visual force. 2. Custom Apex and JavaScript code that is used to manipulate data.
Name two users that can edit a record after it has been locked for approval?
1.An administrator 2. A user who is assigned as the current approver
Name three capabilities of cross-object formula fields?
- Formula fields can expose data the user does not have access to in a record. 2. Formula fields can reference fields from objects that are up to 10 relationships away. 3. Formula fields can reference fields from master-detail or lookup parent relationship.
On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID parameter that is passed on the URL?
Use the constructor method for the controller)
Describe two situations when would a developer use a custom controller instead of a controller extension?
- When a Visualforce page needs to replace the functionality of a standard controller. 2. When a Visualforce page should not enforce permissions or field -level security.
If a developer has a block of code that omits some statements from being shared but the organization-wide dafault is different, what will happen.
The Apex Controllers will automatically obey the organization-wide sharing defaults.
What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, with the result “!Multiple in hitting a governor limit”?
Any changes up to the error are rolled back.
Which control statement should a developer use to implement set of code that executes for every record in the recordset, without performing a .size() or .length() method call when the number of records in recordset are unknown?
For (variable : list_or_set) {
Describe two best practices for a developer to follow when writing a trigger?
- Using the Map data structure to hold query results by ID. 2. Using the Set data structure to ensure distinct records.
Describe two actions a developer can perform in a before update trigger.
- Change field values using the Trigger.new context variable. 2. Display a custom error message in the application interface
A developer creates a method in an Apex class and needs to ensure that errors are handled properly. What would the developer use?
A custom exception.addError() and A try/catch construct
In the code below, what type does Boolean inherit from?
Boolean b = true;
object
Which standard field needs to be populated when a developer inserts new contact records programmatically?
LastName
What are three capabilities of formula fields?
- Determine which of three different images to display using the IF function. 2. Generate the link using the HYPERLINK function using a specific record in a legacy system. 3. Determine if a datetime field has passed using the NOW function.
Does a roll-up summary field work with a look-up relationship?
No, roll-up summary field only works with master-detail relationships.
Name three areas where custom rollup summary fields can be created using Standard Object relationships?
- On Campaign using Campaign member records. 2. On Account using Opportunity records. 3. On Opportunity using Opportunity Product records
Your client hires a new intern. The intern is not allowed to view Opportunities, but needs to see the Most Recent Closed Date of all child Opportunities when viewing an Account record. What would a developer do to meet this requirement?
Create a rollup summary field on the Account object that performs a MAX on the Opportunity Close Date field.
On which object can an administrator create a rollup summary field?
Any object that is on the master side of a master-detail relationship
What would you use when a record has certain values?
Three of our tools can address this use case: Workflow, Process Builder, and Visual Workflow. Respectively, these tools create workflow rules, processes, and flows.
What would you use if you need to get information from customers and do something with it?
Visual Workflow is the tool for you. Create a flow that displays information to and requests information from a user.
Name three declarative methods that help ensure quality data?
Validation rules, Lookup filters, Page layouts
A developer wrote a workflow email alert on case creation so that an email is sent to the case owner manager when a case is created. When will the email be sent?
After committing to database
The Humane Society uses a custom object to track animals and would like to send adoption candidates information automatically to a third-party system when a adoption candidate is selected to adopt an animal. What can a developer do to accomplish this task?
Create a workflow rule with an outbound message action.
What would a developer do to update a picklist field on related Opportunity records when a modification to the associated Account record is detected?
Create a process with Process Builder
Your client requires that the Lead Source field of the Lead record be populated when a Lead is converted. What would a developer use to ensure that a user populates the Lead Source field prior to converting a Lead?
Validation Rule
A developer wants to list all of the Tasks for each Account on the Account detail page. When a Task is created for a Contact, what does the developer need to do to display the Task on the related Account record?
Nothing. The Task is automatically displayed on the Account page.
An interviewer is required to enter a reason in the comments field only when a candidate is recommended to be hired. Which action can a developer take to enforce this requirement?
Create a validation rule
What are two valid statements about Apex classes and interfaces?
The default modifier for a class is private, Exception classes must end with the word exception.
A developer writes a before insert trigger. How can the developer access the incoming records in the trigger body?
By accessing the Trigger.new context variable.
A developer needs to automatically populate the ReportsTo field in a Contact record based on the values of the related Account and Department fields in the Contact record.Which type of trigger would the developer create?
Before update ,Before insert
How can a developer avoid exceeding governor limits when using an Apex Trigger?
- By performing DML transactions on lists of Objects , 2. By using maps to hold data from query results
Identify two requirements that need to be implemented by using standard workflow instead of Process Builder?
Send an outbound message without Apex code AND Create activities at multiple intervals
In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex?
As a String with each value separated by a semicolon.
What are three things you need to know about variable scope?
- A variable can be defined at any point in the block. 2. Parallel blocks can use the same variable name. 3. Sub-blocks cannot reuse the same variable name.
What type of primitive data does Apex automatically assign to a currency field?
Decimal
Name three data types or collection of data types that SOQL statements populate or evaluate to?
- An integer, 2. A list of sObjects 3. A single sObject)
Name two ways a developer can display all of the available record types for a case object
- Use Schema.PickListEntry returned 2. Use Schema.RecordTypeInfo returned