Salesforce PD1 Questions Flashcards
(97 cards)
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.