PD2 Flashcards

A
A company has a custom object. Order__c, that has a custom picklist field. Status__c, with values of New, In Progress,’ or Fulfilled and a
lookup field, Contact_c, to Contact. Which SOQL query wrii return a unique list of all the Contact records that have no Fulfilled Orders?
A . SELECT Contact_c From order_c Where id NOT IN (SELECT id FROM_c Where States_c + Fulfilled’)
B . SELECT iD FROM Contact WHERE id NOT IN (SELECT id From order_c WHERE_c = Fulfilled’)
C . SELECT Contact_c FROM Order_c Where Status_c <> ;Fulfilled’
D . SELECT id FROM Contact WHERE id NOT IN (SELECT Contact _c FROM order_c Where Status_c = fulfilled’)
D
A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user’s input, when the search Is completed, a searchComplete event is fired, with the results put in a results aribute of the event. The component is designed to be used within other components and may appear on a single page more than once.
What is the opmal code that should be added to fire the event when the search has completed?
A.
var evt = component.getEvent(“searchComplete”);
evt. setParams([results: results]);
evt. fire();
B.
var evt = $A.get(“e.c.searchComplete”);
evt. setParams([results: results]);
evt. fire();
C.
var evt = component.getEvent(“searchComplete”);
evt. setParams([“v.results”, results]);
evt. fire();
D.
var evt = $A.get(“e.c.searchComplete”);
evt. setParams([“v.results”, results]);
evt. fire();
B

D
Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.
Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.
The developer verified that the Queries return a single record each and there is error handing in the Lightning component, but the component is not getting anything back when calling the controller getSomeData().
What is wrong?
A . The member’s Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled too.
B . The member’s Name and Option should not be declared public.
C . The member’s Name and Option should not have get and set.
D . Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component.

A

A

A,D
When should you use the ‘transient’ property on variables?
A . Variables that you want transmied as part of the view state. Stac variables also don’t get transmied
B . Variables that you don’t want transmied as part of the view state. Stac variables also don’t get transmied C . Stac variables that you want transmied as part of the view state to save space
D . Large variables in order to save space
B
if the ‘PageReference.setRedirect’ Apex function is set to False, what type of request is made?
A . Get request
B . Postback request
C . If PageReference points to the same controller and subset of extensions, postback request, otherwise get request
C
If the ‘PageReference.setRedirect’ Apex funcon is set to True, what type of request is made?
A . Get request
B . Postback request
C . If PageReference points to the same controller and subset of extensions, postback request, otherwise get request
A
The ‘acon’ aribute on is ONLY evaluated on which type of request?
A . Get request
B . Postback request
A
What is the correct order of execuon for Visualforce Page ‘postback’ requests (when user interacon requires a page update)?
A . 1) Decode View State
2) Evaluate expressions and method calls for the main page and custom components 3) Upon successful compleon, Evaluate the acon that triggered the postback
4) Upon successful compleon, Update data and redirect user/update view state
5) HTML sent to browser
B . 1) Evaluate expressions and method calls for the main page and custom components 2) Decode View State
3) Upon successful compleon, Update data and redirect user/update view state
4) Upon successful compleon, Evaluate the acon that triggered the postback
5) HTML sent to browser
C . 1) Decode View State
2) Evaluate expressions and method calls for the main page and custom components
3) Upon successful compleon, Update data and redirect user/update view state
4) Upon successful compleon, Evaluate the acon that triggered the postback
5) HTML sent to browser
A
If you have a method ‘doStuff(List<sobject> records)', which is a valid call?</sobject>
A . doStuff([Select Id From Account]); B . doStuff(List records);
C . doStuff(Account acct);
D . doStuff(sObject obj);
A
During the Visualforce Page execuon, what step follows immediately aer ‘Evaluate constructors on controller and extensions’?
A . Create the view state
B . Evaluate constructors, extensions, and expression on aribute definions on any custom components present C . Evaluate expressions, aribute acons, and other method calls (geers/seers) on main page
D . Send HTML to Browser
B
The ‘Webservice’ keyword___________.
A . Method must be stac, and class must be global
B . Can be used on all classes
C . Used for any member variables included
D . All of the above
D
What is the transacon limit on the number of ‘sendEmail’ method calls?
A . 20
B . 10
C . 50
D . 100
E . There is no limit Explanaon Explanaon/Reference:
B
What is the correct order of execuon for Visualforce Page ‘get’ requests (inial page visit)?
A . Evaluate constructors on controller and extensions
2) If there’s a element, create the view state
3) Evaluate expressions, aribute acons, and other method calls (geers/seers) on main page
4) Evaluate constructors, extensions, and expression on aribute definions on any custom components present
5) Send HTML to Browser
B . Evaluate constructors, extensions, and expression on aribute definions on any custom components present
2) Evaluate constructors on controller and extensions
3) Evaluate expressions, aribute acons, and other method calls (geers/seers) on main page
4) If there’s a element, create the view state
5) Send HTML to Browser
C . Evaluate constructors on controller and extensions
2) Evaluate constructors, extensions, and expression on aribute definions on any custom components present 3) Evaluate expressions, aribute acons, and other method calls (geers/seers) on main page
4) If there’s a element, create the view state
5) Send HTML to Browser
C
A developer writes the following code:
While tesng the code, the developer receives the following error message: System.CalloutExcepon : You have uncommied work pending What should the developer do? (Choose two.)
A . Use the asyncSend() method of the HTTP class to send the request in async context B . Ensure all callouts are completed prior to execung DML statements C . Move the web service callout into an future method D . Use Database.insert (order, true) to immediately commit any database changes

B,C
A developer has a page with two extensions overriding the Standard controller for Case.
What will happen when a user clicks the command button?
A . All of the three Save methods will be executed
B . Save from Case Standard Controller will be executed
C . Save from CaseExtensionTwo will be executed
D . Save from CaseExtensionOne will be executed

D
A developer is wring unit tests for the following method:
Which assertion would be used in a negative test case?
A . System.assertEquals(true, isFreezing(null))
B . System.assertEquals (true, isFreezing(‘O’)
C . System.assertEquals(null, isFreezing(‘asdf))
D . System.assertEquals(true, isFreezingClOO’))

C
A custom field Exec_Count_c of type Number is created on an Account object. An account record with value of ‘1’ for a: Exec__Count_c is saved. A workflow field update is defined on the Exec_Count_c field, to increment its value every me an account record is created or updated. The following trigger is defined on the account:
trigger ExecOrderTrigger on Account (before insert, before update, aer insert, aer update){ for (Account accountlnstance: Trigger.New){ if (Trigger . isBefore){ accountlnstance Exec_Count_c += 1; } System, debug (accountlnstance.Exec_Count_c); } }
A . 1,2,3,3
B . 1,2,3,4
C . 2, 2, 4, 4
D . 2,2,3,3
C
A developer has wrien the following method:
stac void processList(List<sobject> input){ Which code block can be used to call the method?</sobject>
A . processList (ace)
B . processList ([FIND ‘Acme’ ‘RETURNING Account])
C . processList([SELECT Id, Name FROM sObject WHERE Type = ‘Account’])
D . for Account ace : [SELECT Id, Name FROM Account])
C
The Contact object has a custom field called ‘Zone.’ Its data type is ‘Text’ and field length is 3. What is the outcome aer execung the following code snippet in the org?
A . Both inserts succeed and the contact record that has the Zone value of ‘PI’IT is set to NULL
B . A paral insert succeeds and the contact record that has the Zone value ‘IAD1 is inserted
C . Both inserts succeed and the contact record that has the Zone value of PITT is truncated
D . An unhandled DML excepon is thrown and no contact records are inserted

D
What is a potenal design issue with the following code?
A . SOQL could be avoided by creang a formula field for StageName in Account from the related Opportunity B . The code will result in a System.LimitExcepon : Too many script statements error
C . The code will result in a System.DmExcepon:Enty_is_Deleted error
D . The code will result in a System.LimitExcepon: Apex CPU me limit exceeded error

D


Performs a potenally long-running callout to an outside web service
Provides a way to confirm that the process executed successfully






























































