Salesforce Application Developer-I Part 3



Q81 Which code represents the Controller in MVC architecture on the Force.com platform.
Choose 2 answers
A. JavaScript that is used to make a menu item display itself.
B. StandardController system methods that are referenced by Visualforce.
C. Custom Apex and JavaScript code that is used to manipulate data.
D. A static resource that contains CSS and Images.

Ans B. StandardController system methods that are referenced by Visualforce.
C. Custom Apex and JavaScript code that is used to manipulate data.

Q82 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 answers
provide Product data entry.
A. Download a Managed Package from the AppExchange that provides a custom Visualforce page to modify.
B. Create a new Visualforce page and an Apex controller to provide Product data entry.
C. Copy the standard page and then make a Visualforce page for product data entry.
D. Download an Unmanaged Package from the AppExchange that provides a custom Visualforce page to modify.

Ans B. Create a new Visualforce page and an Apex controller to provide Product data entry.
D. Download an Unmanaged Package from the AppExchange that provides a custom Visualforce page to modify.

Q83  A developer writes a before insert trigger.
How can the developer access the incoming records in the trigger body?
A. By accessing the Trigger.new context variable.
B. By accessing the Trigger.newRecords context variable.
C. By accessing the Trigger.newMap context variable.
D. By accessing the Tripper.newList context variable.

Ans A. By accessing the Trigger.new context variable.

Q84 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 < 250; 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?
A. 101
B. 100
C. 102
D. 252

Ans B. 100

Q85 The Review_c object have a lookup relationship to the job_Application_c object. The job_Application_c object has a master detail relationship up to the position_c object. The relationship is based on the auto populated defaults?
What is the recommended way to display field data from the related Review _C records a Visualforce page for a single Position_c record?
Select one of the following:
A. Utilize the Standard Controller for Position_c and cross-object Formula Fields on the Job_Application_c object to display Review_c data.
B. Utilize the Standard Controller for Position_c and a Controller Extension to query for Review_c data.
C. Utilize the Standard Controller for Position_c and expression syntax in the Page to display related Review_c through the Job_Applicacion_c inject.
D. Utilize the Standard Controller for Position_c and cross-object Formula Fields on the Review_c object to display Review_c data.

Ans D. Utilize the Standard Controller for Position_c and cross-object Formula Fields on the Review_c object to display Review_c data.

Q86 What is a capability of the Force.com IDE? Choose 2 answers
A. Roll back deployments.
B. Run Apex tests.
C. Download debug logs.
D. Edit metadata components.

Ans B. Run Apex tests.
D. Edit metadata components.
Ref: https://developer.salesforce.com/page/Force.com_IDE


Q87 When would a developer use a custom controller instead of a controller extension?
Choose 2 answers:
A. When a Visualforce page needs to replace the functionality of a standard controller.
B. When a Visualforce page does not reference a single primary object.
C. When a Visualforce page should not enforce permissions or field-level security.
D. When a Visualforce page needs to add new actions to a standard controller.

Ans A. When a Visualforce page needs to replace the functionality of a standard controller.
C. When a Visualforce page should not enforce permissions or field-level security.
Ref: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_def.htm

Q88 What is a valid statement about Apex classes and interfaces?  Choose 2 answers:
A. The default modifier for a class is private.
B. Exception classes must end with the word exception.
C. A class can have multiple levels of inner classes.
D. The default modifier for an interface is private.

ANs A. The default modifier for a class is private.
B. Exception classes must end with the word exception.
Ref: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_java_diffs.htm

Q89 A developer has the following trigger that fires after insert and creates a child Case whenever a new Case is created.
List<Case> childCases = new List<Case>();
for (Case parent : Trigger.new){
Case child = new Case(ParentId = parent.Id, Subject = parent.Subject);
childCases.add(child);
}
insert childCases;
What happens after the code block executes?
A. Multiple child cases are created for each parent case in Trigger.new.
B. child case is created for each parent case in Trigger.new.
C. The trigger enters an infinite loop and eventually fails.
D. The trigger fails if the Subject field on the parent is blank.

Ans C. The trigger enters an infinite loop and eventually fails.
A Developer wants to create a custom object to track Customer Invoices.

Q90 How should Invoices and Accounts be related to ensure that all Invoices are visible to everyone with access to Account?
A. The Account should have a Lookup relationship to the Invoice.
B. The Invoice should have a Master -Detail relationship to the Account.
C. The Account should have a Master -Detail relationship to the Invoice.
D. The Invoice should have a Lookup relationship to the Account.

Ans B. The Invoice should have a Master -Detail relationship to the Account.
Reasons:
It has to be master detail relationship to ensure that all child records are visible to everyone with access to Master(Account)
The Invoice should have a Master -Detail relationship to the Account ie. Account has to be master NOT the invoice

Q91 What is a valid source and destination pair that can send or receive change sets?
Choose 2 answers:
A. Sandbox to production.
B. Developer edition to sandbox.
C. Developer edition to production.
D. Sandbox to sandbox.

Ans A. Sandbox to production.
D. Sandbox to sandbox.
Reason:
There's three basic combinations: production to sandbox, sandbox to sandbox, and sandbox to production. Any combination is allowed, so long as the orgs are configured to accept incoming change sets, and any sandboxes involved are created from the same production org.

Q92 A developer needs to create records for the object Property__c .The developer creates the following code block:
01 List<Property__c> propertiesToCreate =helperClass.CreateProperties();
02 try {
03
04 } catch (Exception exp) {
05 //Exception handling
06 }
Which line of code would the developer insert at line 03 to ensure that at least some records are created, even if a record have errors and fails to be created?
A. Database.insert(propertiesToCreate, System.ALLOW_PARTIAL);
B. insert propertiesToCreate,
C. Database.insert(propertiesToCreate, false);
D. Database.insert(propertiesToCreate)

Ans C. Database.insert(propertiesToCreate, false);

Q93 When the number of record in a recordset is unknown, which control statement should a developer use to implement a set of code that executes for every record in the recordset, without performing a .size() or .length() method call?
A. For (init_stmt, exit_condition; increment_stmt) { }
B. Do { } While (Condition)
C. For (variable : list_or_set) { }
D. While (Condition) { ... }

Ans C. For (variable : list_or_set) { }

Q94 What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, which then results in hitting a governor limit?
A. Any changes up to the error are saved.
B. Any changes up to the error are rolled back.
C. All changes before a savepoint are saved.
D. All changes are saved in the first Apex class.

Ans B. Any changes up to the error are rolled back.

Q95 A developer has the following code block:
public class PaymentTax {
public static decimal SalesTax = 0.0875;
}
trigger OpportunityLineItemTrigger on OpportunityLineItem (before insert, before update) {
PaymentTax PayTax = new PaymentTax();
decimal ProductTax = ProductCost * XXXXXXXXXXX;
}
To calculate the productTax, which code segment would a developer insert at the XXXXXXXXXXX to make the value the class variable SalesTax accessible within the trigger?
A. SalesTax
B. PayTax.SalesTax
C. PaymentTax.SalesTax
D. OpportunityLineItemTngger.SalesTax

Ans C. PaymentTax.SalesTax

Q96 On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID that is passed on the URL?
A. Use the constructor method for the controller.
B. Use the $Action.View method in the Visualforce page.
C. Create a new PageReference object with the Id.
D. Use the <apex:detail> tag in the Visualforce page.

ANs A. Use the constructor method for the controller.

Q97 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?
A. After Committing to database.
B. Before Committing to database. Calculator
C. Before Trigger execution.
D. After Trigger execution.

Ans A. After Committing to database.

Q98 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?
A. By using ApexMessage.Message() to display an error message after the number of DML statements is exce€
B. By using Messaging.SendEmail() to continue the transaction and send an alert to the user after the number umL statements is exceed
C. By using PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number DML statements is exceeded.
D. By using Limits.getDMLRows() and then displaying an error message before the number of DML statements exceeded.

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

Q99 Which user can edit a record after it has been locked for approval? Choose 2 answers
A An administrator.
B. Any user who approved the record previously.
C. A user who is assigned as the current approver.
D. Any user- with a higher role in the hierarchy.

Ans A An administrator.
C. A user who is assigned as the current approver.

Q100 Which type of information is provided by the Checkpoints tab in the Developer Console?
Choose 2 answers
A. Exception
B. Debug Statement
C. Namespace
D. Time

Ans C. Namespace
D. Time
Ref: https://help.salesforce.com/apex/HTViewHelpDoc?id=code_dev_console_tab_checkpoints.htm&language=en_US

Q101 What is the proper process for an Apex Unit Test?
A. Query for test datapsing SeeAllData=true. Call the method being tested. Verify that the results are correct
B. Create data for testing. Execute runAllTests(). Verify that the results are correct.
C. Create data for testing. Call the method being tested. Verify that the results are correct.
D. Query for test data using SeeAllData=true. Execute runAllTests(). Verify that the results are correct.

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

Q102 Which declarative method helps ensure quality data? Choose 3 answers
A. Exception handling
B. Workflow alerts
C. Validation rules
D. Lookup filters
E. Page layouts

Ans C. Validation rules
D. Lookup filters
E. Page layouts

Q103 What is an accurate constructor for a custom controller named "MyController"?
A. public MyController() {
account = new Account();
}
B. public MyController(SObject obj) {
account = (Account) obj;
}
C. public MyController(List<SObject> objects) {
accounts = (List<Account>)objects;
}
D. public MyController(ApexPages.StandardController stdController) {
account = (Account)stdController.getRecord();
}


Ans A. public MyController() {
account = new Account();
}

Q104 A company wants a recruiting app that models candidates and interviews; displays the total number of interviews 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
A. Create a roll -up summary field on the Candidate object that counts Interview records.
B. Create a master -detail relationship between the Candidate and Interview objects.
C. Create a lookup relationship between the Candidate and Interview objects.
D. Create a trigger on the Interview object that updates a field on the Candidate object.

Ans C. Create a lookup relationship between the Candidate and Interview objects.
D. Create a trigger on the Interview object that updates a field on the Candidate object.

Q105 What is a good practice for a developer to follow when writing a trigger?
Choose 2 answers
A. using the Map data structure to hold query results by ID.
B. Using @future methods to perform DML operations.
C. Using the set data structure to ensure distinct records.
D. Using synchronous callouts to call external systems

Ans A. using the Map data structure to hold query results by ID.
C. Using the set data structure to ensure distinct records.



Q106 Which code block returns the ListView of an Account object using the following debug statement?
system. debug (controller. getListViewOptions ( ) ) ;
A. ApexPages.StandardSetController controller = new
ApexPages.StandardSetController([SELECT Id FROM Account LIMIT 1]);
B. ApexPages.StandardController controller = new
ApexPages.StandardController(Database.getQueryLocator('select Id from Account Limit 1');
C. ApexPages.StandardController controller = new
ApexPages StandardController ( [SELECT Id FROM Account LIMIT 1));
D.ApexPages.StandardSetController controller = new
ApexPages.StandardSetController(Database.getQueryLocator('select Id from Account Limit 1');

Ans D.ApexPages.StandardSetController controller = new
ApexPages.StandardSetController(Database.getQueryLocator('select Id from Account Limit 1');

Refer: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_pages_standardsetcontroller.htm

Q107 Which data type or collection of data types can SOQL statements populate or evaluate to? Choose 3 answers
A. A Boolean
B. An integer
C. A list of sObjects
D. A single sObject
E. A string

Ans B. An integer
C. A list of sObjects
D. A single sObject

Q108 Which action can a developer perform in a before update trigger? Choose 2 answers
A. Update the original object using an update DML operation.
B. Delete the original object using a delete DML operation.
C. Change field values using the Trigger.new context variable.
D. Display a custom error message in the application interface.

Ans C. Change field values using the Trigger.new context variable.
D. Display a custom error message in the application interface.

Q109 Where can debug log filter settings be set?  Choose 2 answers
A. The Filters link by the monitored user's name within the web UI.
B. The Show More link on the debug log's record.
C. On the monitored user's name.
D. The Log Filters tab on a class or trigger detail page.

Ans B. The Show More link on the debug log's record.
D. The Log Filters tab on a class or trigger detail page.

Q110 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';
}
A. B
B. C
C. D
D. A

Ans A. B

Q111 When can a developer use a custom Visualforce page in a Force.com application?
Choose 2 answers
A. To create components for dashboards and layouts.
B. To deploy components between two organizations.
C. To generate a PDF document with application data.
D. To modify the page layout settings for a custom object.

Ans A. To create components for dashboards and layouts.
C. To generate a PDF document with application data.

Q112 Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct?
A. The Lookup Relationship on the Custom Object can prevent the deletion of the Standard Object.
B. The Lookup Relationship cannot be marked as required on the page layout for the Custom Object.
C. The Custom Object will be deleted when the referenced Standard Object is deleted.
D. The Custom Object inherits security from the referenced Standard Objects

Ans A. The Lookup Relationship on the Custom Object can prevent the deletion of the Standard Object.

Q113 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?
A. Create a required comments field.
B. Create a formula field.
C. Create a validation rule.
D. Create a required Visualforce component.

Ans C. Create a validation rule.

Q114 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?
A. Create a Workflow Rule on the Opportunity object that updates a field on the parent Account.
B. Create a formula field on the Account object that performs a MAX on the Opportunity Close Date field.
C. Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field
D. Create a trigger on the Account object that queries the Close Date of the most recent Opportunities.

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

Q115 On which object can an administrator create a roll-up summary field?
A. Any object that is on the master side of a master-detail relationship.
B. Any object that is on the parent side of a lookup relationship.
C. Any object that is on the detail side of a master-detail relationship.
D. Any object that is on the child side of a lookup relationship.

Ans A. Any object that is on the master side of a master-detail relationship.

Q116 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?
A. By using SOQL on the Visualforce page to query for data from the parent record.
B. By using merge field syntax to retrieve data from the parent record.
C. By adding a second standard controller to the page for the parent record.
D. By using a roll-up formula field on the child record to include data from the parent record.

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

Q117 A developer needs to create a Visualforce page that will override 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?
A. In a Controller Extension.
B. In a Custom Controller.
C. In a Standard Controller.
D. In a Standard Extension.

Ans A. In a Controller Extension

Q118 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?
A. Create an Account formula field that displays the Task information.
B. Nothing. The Task is automatically displayed on the Account page.
C. Create a Workflow Rule to relate the Task to the Contact's Account.
D. Nothing. The Task cannot be related to an Account and a Contact.

Ans B. Nothing. The Task is automatically displayed on the Account page.

Q119 What is a capability of a StandardSetController? Choose 2 answers
A. It extends the functionality of a standard or custom controller
B. It allows pages to perform mass updates of records.
C. It allows pages to perform pagination with large record sets.
D. It enforces field -level security when reading large record sets.

Ans B. It allows pages to perform mass updates of records.
C. It allows pages to perform pagination with large record sets.
Ref: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_pages_standardsetcontroller.htm

Q120 A developer has the following code.
try
{
List<String> 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 would be logged?
A. No message is logged
B. Generic Exception
C. List Exception
D. NullPointer Exception

Ans D. NullPointer Exception

No comments:

Post a Comment