+ Start a Discussion
Manish Anand 10Manish Anand 10 

Need answers for below multiple choice questions

1)Which declarative method helps ensure quality data?
  Choose 3 answers

  A.Validation rules
  B.Workflow alerts
  C.Lookup filters
  D.Page Layout

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

3)In the Lightning Component framework, which resource can be used to fire events?
   2 Answers correct
   A.Third-party Javascript code
   B.Javascript controller actions
   C.Third-party web service code.
   D.Visualforce controller actions.

Ans 1)  A,C,D

Explanation :
Workflow alerts can't restrict data whereas other options are essentially used for the same. Workflow rules provides 4 actions
a) Email alert 
b) Task
c) Field update
d) Outbound message
From above 4 actions a,b,d can be put in workflow alert category and none of them can restrict user to fill absurd data.
Also if you are confused with Field updation( though it is not anywhere in the scenario) it can't restrict user to fill absurd data though you can later update the field.

Ans 2) C

Explanation :
A -  You cannot catch limit exceptions.thus no way to continue transaction and send Email.
B -  ApexMessage.Message()  not provided by salesforce(ApexMessage class not defined).
D -  PageReference.setRedirect() sets the value of the PageReference object's redirect attribute, it can't calculate dml limits.

Ans 3) A,B

Explanation :


Manish Anand 10Manish Anand 10
Thanks Lokesh for your explanation.Below is few more.

1)A candidate may apply to multiple jobs at the company Universal Containers by submtting a single application per job posting. 
Once an application is submitted for a job posting, that application cannot be modified to be resubmitted to a different job posting.
What can the administrator do to associate an application with each job posting in the schema for the organization?

  A.Create a master-detail relationship in the Application custom object to the Job Postings custom object.
  B.Create a master-detail relationship in the Job Postings custom object to the Applications custom object.
  C.Create a lookup relationship on both objects to a junction object called Job Posting Applications.
  D.Create a lookup relationship in the Applications custom object to the Job Postings custom object

  Looks like A.

2)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?
  A. Create a master-detail relationship to represent the one-to-many model of engines to parts
  B. Create a junction object to relate many engines to many parts through a master-detail relationship
  C. Create a lookup relationship to represent how each part relates to the parent engine object.
  D. Create a junction object to relate many engines to many parts through a lookup relationship

 Looks like A. However, answer given is B.Not sure, what I am missing.

3)How can a developer avoid exceeding governor limits when using an Apex Trigger?
  A.By using Maps to hold data from query results
  B.By performing DML transactions on lists of sObjects
  C.By using a helper class that can be invoked from multiple triggers
  D.By using the Database class to handle DML Transactions
Answer seems to be- A,B (Wanted to confirm)

4)A developer wants to display all 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 answers.
   A.Use Schema.PicklistEntry returned by Case.Status.getDescribe().getPicklistValues()
   B.Use SOQL to query Case records in the org to get all the RecordType values available for Case
   C.Use Schema.RecordTypeInfo returned by Case.sObjectType.getDescribe().getRecordTypeInfos()
   D.Use SOQL to query Case records in the org to get all values for the Status picklist field

   A is one. Not sure B or C.