Topic 1 : Exam Pool A
What are two valid options for iterating through each Account in the collection List
A. for (Account theAccount : AccountList) {…}
B. for(AccountList) {…}
C. for (List L : AccountList) {…}
D. for (Integer i=0; i < AccountList.Size(); i++) {…}
Which approach should a developer take to automatically add a “Maintenance Plan” to each Opportunity that includes an “Annual Subscription” when an opportunity is closed?
A. Build a OpportunityLineItem trigger that adds a PriceBookEntry record.
B. Build an OpportunityLineItem trigger to add an OpportunityLineItem record.
C. Build an Opportunity trigger that adds a PriceBookEntry record.
D. Build an Opportunity trigger that adds an OpportunityLineItem record.
A developer working on a time management application wants to make total hours for each timecard available to application users. A timecard entry has a Master-Detail relationship to a timecard.
Which approach should the developer use to accomplish this declaratively?
A. A Visualforce page that calculates the total number of hours for a timecard and displays it on the page
B. A Roll-Up Summary field on the Timecard Object that calculates the total hours from timecard entries for that timecard
C. A Process Builder process that updates a field on the timecard when a timecard entry is created
D. An Apex trigger that uses an Aggregate Query to calculate the hours for a given timecard and stores it in a custom field
A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent. Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?
A. Create and populate a custom field on the parent object marked as Unique.
B. Create a custom field on the child object of type External Relationship.
C. Create and populate a custom field on the parent object marked as an External ID.
D. Create a custom field on the child object of type Foreign Key.
When an Account’s custom picklist field called Customer Sentiment is changed to a value of “Confused”, a new related Case should automatically be created.
Which two methods should a developer use to create this case? (Choose two.)
A. Process Builder
B. Apex Trigger
C. Custom Button
D. Workflow Rule
Which statement results in an Apex compiler error?
A. Map lmap = new Map([Select ID from Lead Limit 8]);
B. Date d1 = Date.Today(), d2 = Date.ValueOf(‘2018-01-01’);
C. Integer a=5, b=6, c, d = 7;
D. List s = List{‘a’,‘b’,‘c’);
How can a developer set up a debug log on a specific user?
A. It is not possible to setup debug logs for users other than yourself.
B. Ask the user for access to their account credentials, log in as the user and debug the issue.
C. Create Apex code that logs code actions into a custom object.
D. Set up a trace flag for the user, and define a logging level and time period for the trace.
A method is passed a list of generic sObjects as a parameter. What should the developer do to determine which object type (Account, Lead, or Contact, for example) to cast each sObject?
A. Use the first three characters of the sObject ID to determine the sObject type.
B. Use the getSObjectType method on each generic sObject to retrieve the sObject token.
C. Use the getSObjectName method on the sObject class to get the sObject name.
D. Use a try-catch construct to cast the sObject into one of the three sObject types
A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. Which step should the developer take to resolve the issue and properly test the exception?
A. Use try/catch within the unit test to catch the exception.
B. Use the finally bloc within the unit test to populate the exception.
C. Use the database methods with all or none set to FALSE.
D. Use Test.isRunningTest() within the custom controller
An org has a single account named ‘NoContacts’ that has no related contacts. Given the query: List
A. accounts[0].contacts is invalid Apex.
B. accounts[0].contacts is an empty Apex.
C. accounts[0].contacts is Null.
D. A QueryException is thrown.
Page 6 out of 40 Pages |
Previous |