PD1: Logic and Process Automation Part 3 (46%)

A developer would like to retrieve the developer name for a certain record type of the Opportunity object. Which method of the RecordTypeInfo class can be used for this?
Choose 1 answer.

A. getRecordTypeName()
B. getName()
C. getRecordType()
D. getDeveloperName()

Answer: D

Given the Visualforce page code below:

<apex:page controller=”SampleController”>
<apex:pageBlock>
<apex:repeat value=”{!productList}” var=”prd”>
Product Name: {!prd.Name}
Price: {!prd.Price}
Description: {!prd.Description}
</apex:repeat>
</apex:pageBlock>
</apex:page>

The getter method in the controller method should be named as?

Choose 1 answer.

A. setproductList
B. getproductList
C. productListExtension
D. productList

Answer: B

Given the traditional FOR loop standard syntax:

for (initialization; exit_condition; increment) {
statement(s)
}

How does the for-loop sequentially perform its operation?

I. The initialization expression initializes the loop.
II. The code block will be executed.
III. Evaluate the exit_condition. If true, the loop continues. If false, the loop exits.
IV. Execute the increment statement and evaluate the exit_condition again.
Choose 1 answer.

A. I, II, IV, III
B. I, III, II, IV
C. I, II, III, IV
D. III, I, II, IV

Answer: B

Metadata information about certain custom apps in a Salesforce org is required in order to render them in the user interface of a mobile app. Which of the following can be used by a developer to return the metadata for this requirement?
Choose 1 answer.

A. Schema.DescribeTabSetResult[] r = Schema.describeTabs();
B. Schema.DescribeAppResult[] r = Schema.describeApps();
C. Schema.DescribeTabResult[] r = Schema.describeTabs();
D. Schema.DescribeSObjectResult[] r = Schema.describeSObjects();

Answer: A

A developer would like to return the developer name of a particular record type using a method of the ‘RecordTypeInfo’ class. Which method is available for this use case?
Choose 1 answer.

A. getName()
B. getRecordTypeInfosByName()
C. getRecordTypeInfosByDeveloperName()
D. getDeveloperName()

Answer: D

A developer needs to update 10,005 Account records in an organization. What method can the developer use to avoid governor limits?
Choose 1 answer.

A. Write code to include a limit clause to restrict the number of records selected for processing
B. Create a method with the @future annotation
C. Write the code in an anonymous block
D. Use Batch APEX

Answer: D

A developer should keep in mind which of the following about getter and setter methods?
Choose 3 answers.

A. Any setter methods in a controller are automatically executed before any action methods.
B. Getter methods must always be named getVariable while setter methods must always be named setVariable.
C. Getters methods may include increment a variable, write a log message, or add a new record to the database.
D. While a getter method is always required to access values from a controller, it’s not always necessary to include a setter method to pass values into a controller.

Answers: A, B and D

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. Standard List
D. Extension

Answers: A and D

Which of the following statements are true about using the transient keyword in a custom controller?
Choose 3 answers.

A. Use the transient keyword to declare instance variables that can’t be saved, and should not be transmitted as part of the view state for a Visualforce page.
B. Declaring variables as transient increases view state size.
C. The transient keyword can be use for a field on a Visualforce page that is needed only for the duration of a page request.
D. Developer can use transient in classes that define the types of fields declared in the serializable classes.

Answers: A, C and D

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. URLFOR
D. IMAGEPROXYURL

Answer: D

A developer needs to create a new account record with the following details:

Account Name = Sample Account
Account Number = 123456789
Account Rating = Hot
Billing Country = Australia

Which of the following options is a proper way of assigning these values in an account sObject?
Choose 1 answer.

A. Account acc = new Account[Name = ‘Sample Account’, AccountNumber = 123456789, Rating = ‘Hot’, BillingCountry = ‘Australia’];
B. acc = new Account<Name = ‘Sample Account’, AccountNumber = 123456789, Rating = ‘Hot’, BillingCountry = ‘Australia’&lg;
C. Account acc = new Account; Account.Name = ‘Sample Account’; Account.AccountNumber = 123456789; Account.Rating = ‘Hot’; Account.BillingCountry = ‘Australia’;
D. Account acc = new Account(Name = ‘Sample Account’, AccountNumber = ‘123456789’, Rating = ‘Hot’, BillingCountry = ‘Australia’);

Answer: D

There is a requirement to display the total expected revenue of opportunities associated with an Account record. How can this be achieved?
Choose 1 answer.

A. Create a roll-up summary field on the Opportunity object and display on the Account page layout
B. Create a trigger on Opportunity to populate a custom field on the Account object
C. Create a roll-up summary field on the Account object using SUM on the Opportunity
D. Create a workflow on the Opportunity object to populate a custom field on the Account object.

Answer: C

How can a developer check the maximum number of digits for an integer field?
Choose 1 answer.

A. Use the getScale() method of the DescribeFieldResult Class
B. Use the getSize() method of the DescribeFieldResult Class
C. Use the getLength() method of the DescribeFieldResult Class
D. Use the getDigits() method of the DescribeFieldResult Class

Answer: D

Which of the following statements are true about using a SOQL for loop to process records in Apex code?
Choose 2 answers.

A. SOQL for loop can only be used to execute code once per sObject record
B. Using a SOQL for loop, it is possible to perform a DML operation on a list of sObjects at a time
C. A SOQL for loop can process records in batches of 500
D. SOQL for loop can be used to avoid the limit on heap size

Answers: B and D

Of the following, which can use a roll-up summary field?
Choose 3 answers.

A. Opportunities using the values of opportunity products related to the opportunity
B. Accounts using the values of related opportunities
C. Campaigns using campaign member status or the values of campaign member custom fields
D. Account using the values of related cases

Answers: A, B and C

If there are account records named ‘Express Logistics’, ‘Global Insurance’ and ‘Tyler Chemicals’ in a Salesforce org, what will be the output returned by the System.debug method when the following Apex code is run?

Integer c = [SELECT Count() FROM Account WHERE Name = ‘Express Logistics’ OR Name = ‘Global Insurance’ OR Name = ‘Tyler Chemicals’];
Integer r = Limits.getQueryRows();
System.debug(‘c = ‘ + c + ‘ and ‘ + ‘r = ‘ + r);

Choose 1 answer.

A. c = 1 and r = 1
B. c = 3 and r = 3
C. c = 3 and r = 1
D. c = 1 and r = 3

Answer: C

What will be the result of an unhandled exception on any DML statements?
Choose 1 answer.

A. DML statements will be saved up to the exception point
B. There is no impact on DML statements
C. DML statements will be rolled back
D. A savepoint will be generated

Answer: C

A developer has written the following code in an Apex class to process account records:

for (Account a : acc) {
code_block
}

Which of the following is true about the variable named ‘acc’ in the code above?
Choose 1 answer.

A. The variable can be of any sObject type
B. An increment statement is required with ‘acc’ to execute the ‘code_block’ more than once
C. The variable can be a list or set of account records
D. The ‘code_block’ is executed for only one element of ‘acc’

Answer: C

What is true regarding the mode that a custom controller runs in?
Choose 1 answer.

A. A custom controller always runs in user mode
B. A custom controller runs in user mode by default, however the [without sharing] keyword can be used to run in system mode.
C. A custom controller runs in system mode, however the [with sharing] keyword can be used to run in user mode.
D. A custom controller runs in system mode by default and can never run in user mode.

Answer: C

Given the code below, what will be the result?

Integer i = 0;
String str = ”;

for (Integer x = 0; x < 10; x++) { str = ‘sampleStr’; i = x; } if (i > 9) {
system.debug(str + ‘ A = ‘ + i);
} else if (i < 9) { system.debug(str + ‘ B = ‘ + i); } else { system.debug(str + ‘ C = ‘ + i); } Choose 1 answer.

A. str B = 10
B. sampleStr C = 9
C. str B = 9
D. sampleStr A = 10

Answer: B

A developer has created the following ‘before update’ trigger on the Opportunity object to update the value of a field on any newly updated opportunities automatically:

trigger OpportunityTrigger on Opportunity (before update) {

for (Opportunity opp : Trigger.new) {

switch on opp.StageName {
when ‘New’ {
opp.Status__c = ‘New’;
}
when ‘Closed Won’ {
opp.Status__c = ‘Order Required’;
}
when ‘Closed Lost’ {
opp.Status__c = ‘Cancelled’;
}
when else {
opp.Status__c = ‘Awaiting Closure’;
}
}

}
}

What will be the value of the Status__c field if a sales representative wins a sales deal and closes the corresponding opportunity record in Salesforce?
Choose 1 answer.
A. Order Required
B. Awaiting Closure
C. Closed
D. Closed Won

Answer: A

What is true regarding cascading execution of triggers?
Choose 1 answer.

A. Cascading execution of triggers will cause an exception
B. Cascading triggers are part of the same execution context with respect to governor limits
C. Each trigger will start a new execution context
D. There is a limit of 5 triggers that can be executed from a cascading execution

Answer: B

A developer has created two custom objects with API names ‘Sales Order__c’ and ‘Shipment__c’ to track orders and shipments related to them. Sales Order is the parent in the master-detail relationship between the two objects. The Shipment object has a custom field named ‘Tracking_Number__c’ that indicates the tracking number associated with a particular shipment. The developer is writing an Apex class in which he needs to retrieve all the sales orders and the tracking numbers associated with their shipment records using a SOQL query. Which of the following represents the correct syntax of the query?
Choose 1 answer.

A. SELECT Name, (SELECT Tracking_Number__c FROM Sales_Order__c.Shipment__c) FROM Sales_Order__c
B. SELECT Name, (SELECT Tracking_Number__c FROM Shipments__r) FROM Sales_Order__c
C. SELECT Name, (SELECT Tracking_Number__c FROM Shipment__c) FROM Sales_Order__c
D. SELECT Sales_Order__c.Name, Shipment__c.Tracking_Number__c FROM Sales_Order__c, Shipment__c

Answer: B

A developer created a simple VF page calculator that has 2 numerical input fields and performs an arithmetic operation based on the user input. What method should the developer use in order to process and calculate the input of the user in the controller?
Choose 1 answer.

A. Process Method
B. Input Method
C. Setter Method
D. Pass Method

Answer: C

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. Overriding existing standard functionality
B. Make a callout to an external web service
C. Run the Visualforce page entirely in system mode
D. Using object record pagination.

Answer: D

Which of these methods are valid ways to initialize a list?
Choose 3 answers.

A. List<Account> accList = new List<Account>();
B. Account[] accList = new Account[]{};
C. List<Account> new = ‘accList’;
D. List<Account> accList = new Account[]{};

Answers: A, B and D

What are some of the limitations of changing the data type of a custom field?
Choose 3 answers.

A. The option to change the data type of a custom field is not available for all data types.
B. The file field type in Salesforce Knowledge can be changed as long as it is not referenced in a Apex Class.
C. Developers cannot change the data type of a custom field that is referenced by a Visualforce page.
D. Developers cannot change the data type of a custom field if it is referenced in Apex.

Answers: A, C and D

An administrator working for Cosmic Solutions has created a formula field on the Opportunity object to calculate discount based on the values of some fields on the object. A developer who is using the formula field in an Apex class wants to determine whether it treats any blank number fields as zeros. Which method of the DescribeFieldResult class can be used to obtain the information for this use case?
Choose 1 answer.

A. isFormulaBlankNumberZero()
B. isFormulaNullNumberZero()
C. isFormulaTreatNullNumberAsZero()
D. isFormulaTreatBlankNumberAsZero()

Answer: C

If a developer needs to skip to the next iteration of a loop, what loop control structure should be used?
Choose 1 answer.

A. end;
B. break;
C. skip;
D. continue;

Answer: D

A developer needs to write some code that will display ‘Dreamforce 2018’ if the string variable getAnswer is equal to ‘Salesforce’. No action is required if the variable is not equal to ‘Salesforce’. What control flow statement should the developer use?
Choose 1 answer.

A. Repeat ELSE-IF statement
B. SWITCH statement
C. IF-ELSE statement
D. IF statement

Answer: D

Apex and Visualforce pages are prone to data access control issues. Which approach helps address these issues?
Choose 1 answer.

A. Use the [with sharing] keyword in Apex classes
B. Use the [without sharing] keyword in Apex classes
C. Use the [shareable] keyword in Apex classes
D. Use the [non shareable] keyword in Apex classes

Answer: A

A developer executed a for-loop and needs to stop the loop action when a certain value was found. What loop control structure syntax can the developer use inside the for-loop code?
Choose 1 answer.

A. break;
B. continue;
C. end;
D. skip;

Answer: A

Apex and Visualforce pages are prone to data access control issues. Which approach helps address these issues?
Choose 1 answer.

A. Use the [with sharing] keyword in Apex classes
B. Use the [without sharing] keyword in Apex classes
C. Use the [shareable] keyword in Apex classes
D. Use the [non shareable] keyword in Apex classes

Answer: A

Exceptions show errors and other events that disrupt the normal flow of code execution. Which of the following statements are true about Apex Exception Handling?
Choose 3 answers.

A. The catch statement identifies a block of code that handles a particular type of exception.
B. You can have multiple Catch blocks to catch all different kinds of exceptions. If you use a generic exception catcher, it must be the first Catch block.
C. The finally statement is required and gets executed after the catch block executes.
D. Comparatively, a throw statement allows you to signal that an error has occurred, while try, catch, and finally can be used to pull through from an exception.
E. The try statement identifies a block of code in which an exception could occur.

Answers: A, D and E

How can SOQL injection be prevented?
Choose 1 answer.

A. Use the preventQuotes method
B. Use the escapeSingleQuotes method
C. Use the preventInjection method
D. Use the preventDatabaseCommands method

Answer: B

A VisualForce page uses a custom Apex controller class. An ID parameter value was passed to the URL. How can a developer retrieve the record using this value?
Choose 1 answer.

A. Use ApexPages.currentPage().getHeaders() to get the parameter value then make a query to the record using the ID in the controller’s constructor.
B. Use ApexPages.currentPage().getParameters() to get the parameter value then make a query to the record using the ID in the controller’s constructor.
C. Use ApexPages.currentPage().getAnchor() to get the parameter value then make a query to the record using the ID in the controller’s constructor.
D. Use ApexPages.currentPage().getContent() to get the parameter value then make a query to the record using the ID in the controller’s constructor.

Answer: B

After reviewing the following code, what comments would you provide?

public String personnelSearch {get;set;}

string dep = ApexPages.currentPage().getParameters().get(‘department’);
if (dep != null) {
string query = ‘select id, name from ‘+dep+’ limit 10′;
// some code here
}
Choose 1 answer.

A. Add more fields and expand limits [limit 10] on string query to refine search.
B. Define exact condition in [if(dep != null)] and avoid using null.
C. It is not advisable to use string queries. Refrain from using those.
D. The code is working well. Keep it up!
E. Use a variable instead of getting a parametric value on URL.

Answer: B

Which of the following are considered security vulnerabilities in Apex and Visualforce Development?
Choose 3 answers.

A. SOQL Injection
B. Cross-Site Scripting (XSS)
C. SOQL Direct Insert
D. Cross-Site Request Forgery (CSRF)

Answers: A, B and D

A developer is required to create an Apex Trigger to populate the KeyPerson__c field on the Case object based on field values in its related Account record. In which trigger should this be created?
Choose 2 answers.

A. Before insert
B. After update
C. After insert
D. Before update

Answers: A and D

What is true about how Salesforce deals with cross-site scripting (XSS) attacks?
Choose 2 answers.

A. All standard Visualforce components, which start with <apex>, have anti-XSS filters in place.
B. Custom JavaScript is protected from XSS.
C. Salesforce has implemented filters that screen out harmful characters in most output methods as one of the anti-XSS defenses.
D. Escape should be enabled for Visualforce Tags e.g. <apex:outputText escape=”true” value=”{!$CurrentPage.parameters.userInput}” />

Answers: A and C

Which of these methods are valid ways to initialize a list?
Choose 3 answers.

A. List<Account> new = ‘accList’;
B. Account[] accList = new Account[]{};
C. List<Account> accList = new Account[]{};
D. List<Account> accList = new List<Account>();

Answers: B, C and D

Which of the following is a valid assignment?
Choose 1 answer.

A. Map oppMap = [SELECT Id, Name, StageName FROM Opportunity];
B. private static constant Double rate = 7.75;
C. String alphabet = “abc”;
D. Lead[] leadList = new List<Lead>();

Answer: D

A developer needs to write some code that will display ‘Dreamforce 2018’ if the string variable getAnswer is equal to ‘Salesforce’. No action is required if the variable is not equal to ‘Salesforce’. What control flow statement should the developer use?
Choose 1 answer.

A. IF statement
B. IF-ELSE statement
C. Repeat ELSE-IF statement
D. SWITCH statement

Answer: A

A developer is unable to delete a custom field as it is referenced somewhere in Salesforce. Which of the following might contain the conflicting reference?
Choose 3 answers.

A. Apex Class
B. Dynamic SOQL
C. Workflow Field Update
D. Formula field

Answers: A, C and D

Which of the following Apex control statements allows a developer to iterate on each element of a collection of an unknown size?
Choose 1 answer.

A. For(Type variable: listOrSet) loop
B. While-Do loop
C. Do-While loop
D. While loop

Answer: A

An assignment statement is any statement that places a value into a variable. Which one of the following expressions is a valid Apex assignment statement?
Choose 1 answer.

A. Map<Id, Account> = [SELECT Id, Name FROM Account];
B. Account acc = new Account();
C. List<Contact> conList = new [SELECT Id FROM Contact];
D. String a = new String(‘sampleString’);

Answer: B

Which of the following corresponds to the proper declaration of a constant variable?
Choose 1 answer.

A. global static Integer privCons = 250;
B. public static String privCons = ‘Private’;
C. private String privCons = ‘Private’;
D. static final Integer privCons = 200;

Answer: D

If a developer needs to skip to the next iteration of a loop, what loop control structure should be used?
Choose 1 answer.

A. end;
B. continue;
C. skip;
D. break;

Answer: B

What will be the result of the following code if there are 2 accounts named ABC?

Account myAccount = [SELECT id, name FROM Account WHERE name = ‘ABC’];

Choose 1 answer.

A. myAccount will be assigned the second account returned from the query
B. An exception will be thrown
C. myAccount will be assigned the first account returned from the query
D. myAccount will be null

Answer: B

A developer needs to declare and initialize a variable as a constant. How can this requirement be met?
Choose 1 answer.

A. Use the FINAL keyword on initialization
B. Use the PRIVATE keyword on initialization
C. Use the TRANSIENT keyword on initialization
D. Use the THIS keyword on initialization

Answer: A

In an update trigger, how can a list of the previous versions of the records be accessed?
Choose 1 answer.

A. By accessing the Trigger.previous context variable
B. By accessing the Trigger.oldList context variable
C. By accessing the Trigger.old context variable
D. By accessing the Trigger.updated context variable

Answer: C

Numerical variables can be initialized in many ways. Which of the following are valid numerical Apex variable declarations?
Choose 3 answers.

A. Blob int;
B. Integer a;
C. Decimal num;
D. Double avg;
E. ID num;

Answers: B, C and D

SOQL statement results can evaluate to which of the following data types?
Choose 3 answers.

A. A List of sObjects
B. An Integer
C. A String
D. A Single sObject

Answers: A, B and D

How can a developer query a multi-select picklist?
Choose 2 answers.

A. Picklist values can only be specified with AND logic
B. Picklist values can only be specified with OR logic
C. Picklist values can be specified with AND / OR logic
D. Semicolon and comma characters can be used to add filters for the multi-select picklist field to the SOQL query

Answers: C and D

A before update trigger has performed validation and determined that the record should not be saved. How can this be dealt with in APEX code?
Choose 1 answer.

A. Raise an unhandled exception
B. Raise a custom exception
C. Use the addError() method
D. Use the break method

Answer: C

Which of these statements about Do-While and While loops are true?
Choose 3 answers.

A. The while statement continually executes a block of statements while a particular condition is true.
B. The do-while statement evaluates its expression at the top of the loop instead of the bottom.
C. A developer can implement an infinite loop using the while statement.
D. The statements within the do block are always executed at least once.

Answers: A, C and D

What is true regarding accessing sharing programmatically?
Choose 3 answers.

A. AccountShare is the sharing object for the Account object
B. Account__Share is the sharing object for the Account object
C. CustomObject__Share is the sharing object for a custom object
D. Objects on the detail side of a master-detail relationship do not have a sharing object

Answers: A, C and D

Which of the following is true regarding list or set iteration for loops?
Choose 3 answers.

A. The variable may or may not be of the same primitive or sObject type as list_or_set.
B. It is usable for loops where you need to replace elements in a list or array as you traverse it.
C. It is not usable for loops that must iterate over multiple collections in parallel.
D. The standard syntax for list or set iteration for loops is: for(Type variable : list_or_set) { code_block }
E. During execution, the variable is assigned to each element in list_or_set, and runs the code_block for each value.

Answers: C, D and E

What are some of the limitations of changing the data type of a custom field?
Choose 3 answers.

A. Developers cannot change the data type of a custom field that is referenced by a Visualforce page.
B. The file field type in Salesforce Knowledge can be changed as long as it is not referenced in a Apex Class.
C. The option to change the data type of a custom field is not available for all data types.
D. Developers cannot change the data type of a custom field if it is referenced in Apex.

Answers: A, C and D

In order to ensure that order records in Salesforce comply with a policy of Cosmic Sporting Goods, a Salesforce Consultant needs to display the conversion rate for an order’s currency on the order detail page. Which formula function can be utilized for this use case?
Choose 1 answer.

A. CURRENTRATE
B. CURRENCYRATE
C. CONVERSIONRATE
D. CURRENCY

Answer: B

Which of the following are true regarding custom setting data?
Choose 2 answers.

A. Custom setting data can be accessed by formula fields, validation rules, Apex and Visualforce pages
B. Custom setting data cannot be queried using SOQL
C. Custom setting data needs to be queried once using SOQL and then it is stored in the cache
D. There are two types of custom setting data, hierarchy and list

Answers: A and D

What will be the result of the following code if there are 2 accounts named ABC?

try {
Account myAccount = [SELECT id, name FROM Account WHERE name = ‘ABC’];
}
catch (Exception e) {
System.debug(‘Exception caught’);
}
System.debug(‘Continuing’);
string myString = ‘Salesforce’;
System.debug(‘String size is ‘ + myString.length());

Choose 1 answer.

A. No exceptions will be thrown and the code will execute normally
B. An exception will be thrown and the code will stop immediately
C. An exception will be caught and the code will stop after executing the code in the catch block
D. An exception will be caught and the code will continue after executing the code in the catch block

Answer: D

How can a developer check if the current user is able to view a particular field?
Choose 1 answer.

A. Use the isAccessible() method of the DescribeField Class
B. Use the isAccessible() method of the DescribeFieldResult Class
C. Use the isViewable() method of the DescribeFieldResult Class
D. Use the isViewable() method of the DescribeField Class

Answer: B

A Currency field is automatically assigned to what data type?
Choose 1 answer.

A. Long
B. Currency
C. Number
D. Decimal

Answer: D

What is true regarding Apex variables?
Choose 1 answer.

A. Only class member variables are initialized to null
B. Only static variables are initialized to null
C. Only method variables are initialized to null
D. All Apex variables are initialized to null

Answer: D

A developer has a custom controller named ‘CustomController1’. What is the correct syntax for the constructor?
Choose 1 answer.

A. public CustomController1(ApexPages.StandardController stdController) { <code here> }
B. public CustomController1() { <code here> }
C. public CustomController1(SObject obj) { <code here> }
D. public CustomController1(Map<SObject> objects) { <code here> }

Answer: B

A developer has declared and initialized a variable named ‘s’ of type String[] to store multiple sObject types. He uses the code below to get describe metadata information for the sObject types.

Schema.DescribeSobjectResult[] r = Schema.describeSObjects(s);

Which method of the DescribeSObjectResult class can be used to determine whether an sObject appears as ‘Account’ in the user interface?
Choose 1 answer.

A. getName()
B. getLabel()
C. isName()
D. isLabel()

Answer: B

The Salesforce Administrator of Cosmic Financial Services is required to create a new formula field on the ‘Contract’ object which calculates the expiration date by adding the ‘Contract Term (months)’ to the ‘Customer Signed Date’ field. Both of these are standard fields on the object. Which of the following represents the correct formula for the new field?
Choose 1 answer.

A. ADD (CustomerSignedDate, ContractTerm)
B. ADDMONTHS (CustomerSignedDate, ContractTerm)
C. ADDDATE (CustomerSignedDate, ContractTerm)
D. DATEVALUE (CustomerSignedDate + ContractTerm)

Answer: B

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. getSObjectName()
C. getSObjectType()
D. getType()

Answer: C

A developer needs to formulate a page that requires uploading an attachment for a specific record with all the fields for the record and the fields required in uploading the document. How can the developer satisfy this requirement?
Choose 1 answer.

A. Custom Controller
B. Standard List Controller
C. Standard Controller
D. Custom List Controller

Answer: A

Which are true regarding a StandardSetController?
Choose 3 answers.

A. Allow pre-built list controllers to be extended
B. The maximum record limit for StandardSetController is 1,000 records.
C. Can be used for mass updates
D. Allow list controllers similar to pre-built Visualforce list controllers to be created

Answers: A, C and D

What Trigger variable outputs the context of the current DML operation?
Choose 1 answer.

A. Trigger.operationType
B. Trigger.dmlType
C. Trigger.dmlContext
D. Trigger.operationContext

Answer: A

Cosmic Solutions would like to define a business process with the following requirements:
1) The business process should be triggered automatically when the stage of an opportunity is set to ‘Closed Won’.
2) Some fields on a related record of a custom object called ‘Sale’ should be updated.
3) A custom object that is used to store sales orders should be updated with data from an external order management system.
Which of the following are valid considerations for using a process that invokes a flow for meeting this requirement?
Choose 2 answers.

A. The process would need to be used to update Salesforce data.
B. The flow can look up data stored in the external system.
C. The flow invoked by the process should not be auto-launched.
D. The flow can access both Salesforce data and external data.

Answers: B and D

A developer needs to execute an automated process when a platform event outside the Salesforce database occurs. How might this be configured?
Choose 3 answers.

A. Use the Salesforce REST API to submit a platform event from another system.
B. Set up email notifications to notify the admin when an external event occurs.
C. Use Process Builder to set up a process to manage an incoming platform event.
D. Subscribe a Flow to wait for the platform event.
E. Use Workflow to set up a workflow rule that will notify the admin when an external event occurs.

Answers: A, C and D

An administrator working for Cosmic Solutions has created a formula field on the Opportunity object to calculate discount based on the values of some fields on the object. A developer who is using the formula field in an Apex class wants to determine whether it treats any blank number fields as zeros. Which method of the DescribeFieldResult class can be used to obtain the information for this use case?
Choose 1 answer.

A. isFormulaTreatBlankNumberAsZero()
B. isFormulaTreatNullNumberAsZero()
C. isFormulaBlankNumberZero()
D. isFormulaNullNumberZero()

Answer: B

A developer needs to display Case records on a Visualforce page using the code below:

Page:
<apex:page controller=” CaseController “>
<apex:pageBlock>
<apex:dataTable value=”{!CaseRecord}” var=”caserec”>
<apex:column>
<apex:facet name=”header”>Case Id</apex:facet>
<apex:outputText value=”{!caserec.Id}”/>
</apex:column>

<apex:column>
<apex:facet name=”header”>Case Subject</apex:facet>
<apex:outputText value=”{!caserec.Subject}”/>
</apex:column>

<apex:column>
<apex:facet name=”header”>Case Priority</apex:facet>
<apex:outputText value=”{!caserec.Priority}”/>
</apex:column>
</apex:dataTable>
</apex:pageBlock>
</apex:page>

Controller:
public class CaseController {

//GETTER METHOD HERE

}

Which of the following options is the appropriate getter method to be used?

Choose 1 answer.

A. public Case CaseRecord () { RETURN [SELECT Id, Subject, Priority from Case WHERE ID =: ApexPages.currentPage().getParameters().get(‘id’)]; }
B. public Case getCaseRecord () { RETURN [SELECT Id from Case WHERE ID =: ApexPages.currentPage().getParameters().get(‘id’)]; }
C. public Case getCaseRecord () { RETURN [SELECT Id, Subject, Priority from Case WHERE ID =:ApexPages.currentPage().getParameters().get(‘id’)]; }
D. public Case getCaseRec () { RETURN [SELECT Subject, Priority from Case WHERE ID =: “5002800000OKxED” ];

Answer: C

Which of the following methods can a developer use to determine if it is close to hitting the DML rows governor limit?
Choose 2 answers.

A. Limits.getLimitDMLRows()
B. System.assert()
C. Limits.getDMLRows()
D. Database.countQuery()

Answers: A and C

In an effort to securely display data in an organization, a developer is modifying any existing custom controllers that do not use a sharing declaration. Which of the following can be used in the definition of a custom controller class to ensure that only records for which the running user has sharing access are displayed when a Visualforce page invokes the class?
Choose 2 answers.

A. The ‘protected’ access modifier
B. The ‘with sharing’ keyword
C. The ‘sharing’ access modifier
D. The ‘inherited sharing’ keyword

Answers: B and D

A developer is going through the Visualforce pages created in his company’s org to identify and fix any potential vulnerabilities. One of the pages uses a static HTML file that has been downloaded from a third-party source. If ‘resource_name’ refers to the name that was specified when the file was uploaded as a static resource, which of the following should the developer use to reference the file on a separate domain and improve security?
Choose 1 answer.

A. $Resource.<resource_name>
B. $IFrameResource.<resource_name>
C. $IFrame.<resource_name>
D. $Library.<resource_name>

Answer: B

A developer has written the following Apex code statement to obtain the describe result for an sObject in Salesforce:

Schema.DescribeSObjectResult dsr = Schema.SObjectType.Account;

Which of the following methods can be used to return a map of developer names of the record types associated with the sObject and their metadata information?
Choose 1 answer.

A. getRecordTypes()
B. getRecordTypeInfos()
C. getRecordTypeInfosByDeveloperName()
D. getRecordTypeInfosByName()

Answer: C

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.