0% found this document useful (0 votes)
14 views9 pages

Salesforce Platform Developer 1

The document contains a series of questions and answers related to Salesforce development concepts, including Apex, triggers, Visualforce, and data modeling. Key topics include how to handle multi-select picklists, the execution order of triggers, and best practices for writing triggers. Additionally, it covers the use of various Salesforce features such as managed packages, roll-up summary fields, and governor limits.

Uploaded by

bryanbiboy95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views9 pages

Salesforce Platform Developer 1

The document contains a series of questions and answers related to Salesforce development concepts, including Apex, triggers, Visualforce, and data modeling. Key topics include how to handle multi-select picklists, the execution order of triggers, and best practices for writing triggers. Additionally, it covers the use of various Salesforce features such as managed packages, roll-up summary fields, and governor limits.

Uploaded by

bryanbiboy95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

1. In a single record, a user selects multiple values from a multi-select picklist.

How are the


selected values represented in Apex?

Ans: As a String with each value separated by a semicolon

2. Which trigger event allows a developer to update fields in the Trigger.new list without using an
additional DML statement?Choose 2 answers

Ans: 1. Before Update, 2. Before Insert

3. Which statement would a developer use when creating test data for products and pricebooks?

Ans: Id pricebookId = Test.getStandardPricebookId();

4. Where would a developer build a managed package?

Ans: Developer Edition

5. Which type of information is provided by the Checkpoints tab in the Developer Console?
(Choose 2)

Ans: Namespace, Time

6. 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?

Ans: After committing to database

7. Which code block returns the ListView of an Account object using the following debug
statement? system.debug(controller.getListViewOptions() );

Ans: ApexPages.StandardSetController controller = new


ApexPages.StandardSetController( Database.getQueryLocator( 'SELECT Id FROM Account LIMIT 1'));

8. The Sales Management team 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?

Ans: Create a roll-up summary field on the Account object that performs a MAX on the Opportunity
Close Date field.

9. What is a benefit of the lightning component framework?

Ans: More pre-built components to replicate the salesforce look and feel

10. What is an accurate constructor for a custom controller named "MyController"?

Ans:

public MyController () {

account = new Account () ;

}
11. What is a valid source and destination pair that can send or receive change sets? (Choose 2)

Ans:

Sandbox to Production

Sandbox to Sandbox

12. How can a developer determine, from the DescribeSObjectResult, if the current user will be
able to create records for an object in Apex?

Ans: By using the isCreatable() method.

13. What is an important consideration when developing in a multi-tenant environment?

Ans: Governor limits prevent tenants from impacting performance in multiple orgs on the same
instance.

14. What is the value of x after the code segment executes?String x = 'A';Integer i = 10;if ( i < 15 ) {i =
15;x = 'B';} else if ( i < 20 ) {x = 'C';} else {x = 'D'; }

Ans: B

15. A developer has the following query: Contact c = [SELECT id, firstname, lastname, email FROM
Contact WHERE lastname = 'Smith']; What does the query return if there is no Contact with the
last name 'Smith'?

Ans: An error that no rows are found.

16. What is a capability of the Developer Console?

Ans: Execute Anonymous Apex code, Create/Edit code, view Debug Logs.

17. What is an accurate statement about variable scope? (Choose 3)

Ans:

Parallel blocks can use the same variable name

A variable can be defined at any point in a block

Sub-blocks cannot reuse a parent block's variable name.

18. Which resource can be included in a Lightning Component bundle? Choose 2 answers

Ans:

Javascript

Documentation
19. Where can the custom roll-up summary fields be created using Standard Object relationships
(Choose 3)

Ans:

On Opportunity using Opportunity Product records.

On Campaign using Campaign Member records.

On Account using Opportunity records.

20. Which scenario is invalid for execution by unit tests?

Ans: Loading test data in place of user input for Flows.

21. A developer needs to create a Visualforce page that will override the standard Account edit
button. The page will be used to validate the account's address using a SOQL query. The page
will also allow the user to make edits to the address. Where would the developer write the
Account address verification logic?

Ans: In a Controller Extension.

22. In which order does Salesforce execute events upon saving a record?

Ans: Before Triggers; Validation Rules; After Triggers; Assignment Rules; Workflow Rules; Commit

23. A developer creates an Apex class that includes private methods. What can the developer do to
ensure that the private methods can be accessed by the test class?

Ans: Add the TestVisible attribute to the apex methods.

24. Which statement about change set deployments is accurate? (Choose 3)

Ans:

They use an all or none deployment model

They require deployment connection

They can be used only to related organization

25. A developer needs to provide a Visualforce page that lets users enter Product-specific details
during a Sales cycle. How can this be accomplished? (Choose 2)

Ans:

Create a new Visualforce page and an Apex controller to provide Product data entry.

Download an Unmanaged Package from the AppExchange that provides a custom Visualforce page
to modify.
26. A Visualforce page has a standard controller for an object that has a lookup relationship to a
parent object. How can a developer display data from the parent record on the page?

Ans: By using merge field syntax to retrieve data from the parent record.

27. What is a capability of formula fields? (Choose 3)

Ans:

Generate a link using the HYPERLINK function to a specific record in a legacy system.

Determine if a datetime field has passed using the NOW function.

Determine which of three different images to display using the IF function.

28. What is the proper process for an Apex Unit Test

Ans: Create data for testing. Call the method being tested. Verify that the results are correct.

29. A developer needs to know if all tests currently pass in a Salesforce environment. Which feature
can the developer use? (Choose 2)

Ans:

Salesforce UI Apex Test Execution

Developer Console

30. When loading data into an operation, what can a developer do to match records to update
existing records? (Choose 2)

Ans:

Match an external Id Text field to a column in the imported file.

Match the Id field to a column in the imported file.

31. A developer wants to create a custom object to track Customer Invoices.How should Invoices
and Accounts be related to ensure that all Invoices are visible to everyone with access to an
Account?

Ans:

The Invoice should have a Master-Detail relationship to the Account

32. Which user can edit a record after it has been locked for approval? (Choose 2)

Ans:

Admin

Assigned current approver

33. A developer in a Salesforce org with 100 Accounts executes the following code using the
Developer console:Account myAccount = new Account(Name = 'MyAccount');Insert
myAccount;For (Integer x = 0; x < 150; x++) {Account newAccount = new Account
(Name='MyAccount' + x);try {Insert newAccount;} catch (Exception ex) {System.debug
(ex) ;}}insert new Account (Name='myAccount');How many accounts are in the org after this
code is run?

Ans: 100

34. A reviewer 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?

Ans: Create Validation Rule

35. A developer writes a SOQL query to find child records for a specific parent. How many levels can
be returned in a single query?

Ans: 5

36. When can a developer use a custom Visualforce page in a Force.com application? (Choose 2)

Ans:

To generate a PDF document with application data

To create components for dashboards and layouts

37. A developer has a block of code that omits any statements that indicate whether the code block
should execute with or without sharing. What will automatically obey the organization-wide
defaults and sharing settings for the user who executes the code in the Salesforce organization?

Ans: Anonymous Blocks

38. A developer wants to display all of the available record types for a Case object. The developer
also wants to display the picklist values for the Case.Status field. The Case object and the
Case.Status field are on a custom Visualforce page. Which action can the developer perform to
get the record types and picklist values in the controller? (Choose 2)

Ans:

Use Schema.PicklistEntry returned by Case.Status.getDescribe().getPicklistValues().

Use Schema.RecordTypeInfo returned by Case.sObjectType.getDescribe().getRecordTypeInfos().

39. A developer creates a custom controller and custom Visualforce page by using the following
code block:public class myController {public String myString;public String getMyString() {return
'getmyString';}public String getStringMethod1() {return myString;}public String
getStringMethod2() {if (myString == null)myString = 'Method2';return myString;}}{!myString}, {!
StringMethod1}, {!StringMethod2}, {!myString}What does the user see when accessing the
custom page?

Ans:

GetMyString , , Method2 , getMystring


40. A company wants a recruiting app that models candidates and interviews; displays the total
number of interviews on each candidate record; and defines security on interview records that
is independent from the security on candidate records. What would a developer do to
accomplish this task? Choose 2 answers

Ans:

Create a lookup relationship between the Candidate and Interview objects.

Create a trigger on the Interview object that updates a field on the Candidate object.

41. What is a capability of a StandardSetController?Choose 2 answers

Ans:

It allows pages to perform mass updates of records

It allows pages to perform pagination with large record sets

42. 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?

Ans: Nothing. The task is automatically displayed on the Account page.

43. What is the minimum log level needed to see user-generated debug statements?

Ans: Debug

44. A developer has the following code:try {List nameList;Account a;String s =


a.Name;nameList.add(s);} catch (ListException le ) {System.debug(' List Exception ');} catch
(NullPointerException npe) {System.debug(' NullPointer Exception ');} catch (Exception e)
{System.debug(' Generic Exception ');} What message will be logged?

Ans: NullPointer Exception

45. What is a good practice for a developer to follow when writing a trigger? (Choose 2)

Ans:

Using the Map data structure to hold query results by ID.

Using the Set data structure to ensure distinct records.

46. Which statement should a developer avoid using inside procedural loops? (Choose 2)

Ans:

List contacts = [SELECT Id, Salutation, FirstName, LastName, Email FROM Contact WHERE AccountId
= :a.Id];

Update contactList;
47. A developer creates an Apex helper class to handle complex trigger logic. How can the helper
class warn users when the trigger exceeds DML governor limits?

Ans:

By using Limits.getDMLRows() and then displaying an error message before the number of DML
statements is exceeded.

48. How can a developer avoid exceeding governor limits when using Apex Triggers? (Choose 2)

Ans:

By using Maps to hold data from query results

By performing DML transactions on a list of sObjects.

49. A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement
can a developer use to retrieve the correct URL for the current user'sprofile and display this on a
Visualforce Page?

Ans: {!$Setup.Url_Settings__C.URL__c}

50. What is a valid way of loading external JavaScript files into a Visualforce page? (Choose 2)

Ans:

Using an (apex:includeScript)* tag. \>


Using a (script)* tag.
51. Which action can a developer perform in a before update trigger? (Choose 2)

Ans:

Display a custom error message in the application interface.


Change field values using the Trigger.new context variable.
52. Which type of code represents the Controller in MVC architecture on the Force.com platform?
(Choose 2)

Ans:

Custom Apex and JavaScript coda that is used to manipulate data.


StandardController system methods that are referenced by Visualforce.
53. A developer needs to create records for the object Property__c. The developer creates the
following code block:List propertiesToCreate = helperClass.createProperties();try { // line 3 }
catch (Exception exp ) { //exception handling }Which line of code would the developer insert at
line 3 to ensure that at least some records are created, even if a few records have errors and fail
to be created?

Ans:

Database.insert(propertiesToCreate, false);
54. Which data type or collection of data types can SOQL statements populate or evaluate to?
(Choose 3)

Ans:

A single sObject
Integer
A List of listObject
55. A developer is creating an application to track engines and their parts. An individual part can be
used in different types of engines.What data model should be used to track the data and to
prevent orphan records?

Ans:

Create a junction object to relate many engines to many parts through a master-detail
relationship
56. Which declarative method helps ensure quality data? (Choose 3)

Ans:

Validation Rules
Lookup Filters
Page Layouts

You might also like