Questions
ayuda
option
My Daypo

ERASED TEST, YOU MAY BE INTERESTED ONPD1 WI 20 example

COMMENTS STATISTICS RECORDS
TAKE THE TEST
Title of test:
PD1 WI 20 example

Description:
PD1 WI 20 example

Author:
pd1Author
(Other tests from this author)

Creation Date:
08/02/2020

Category:
Others

Number of questions: 128
Share the Test:
Facebook
Twitter
Whatsapp
Share the Test:
Facebook
Twitter
Whatsapp
Last comments
AVATAR
JustinT ( uploaded 3 years )
Hi, the test is not loading for me. Can you fix?
Answer
AVATAR
daypo ( uploaded 3 years )
It is already fixed.
Content:
Opportunity opp = [SELECT Id, StageName FROM Opportunity LIMIT 1]; Given the code above, how can a developer get the lavel for the StageName field? Call "Opportunity.StageName.Label". Call "Opportunity.StageName.getDescribe().getLabel()". Call "opp.StageName.getDescribe().getLabel()". Call "opp.StageName.Label".
What is a good practice for a developer to follow when writing a trigger? Choose 2 answers using the Map data structure to hold query results by ID. Using @future methods to perform DML operations. Using the set data structure to ensure distinct records. Using synchronous callouts to call external systems.
In which two trigger types can a developer modify the new sObject records that are obtained by the trigger.new context? Choose 2 answers After insert After update Before update Before insert.
A developer wants multiple test classes to use the same set of test data. How should the developer create the test data? Define a variable for test records in each test classes Create a test setup method for each test class Use the seealldata=true annotation in each test class Reference a test utility class in each test class.
Account acct = [SELECT Id from Account limit 1]; Given the code above, how can a developer get the type of object from acct? Call "acct.getsObjectType()" Call "Account.getSobjectType()" Call "Account.SobjectType" Call "acct.SobjectType".
Which two statement can a developer use to throw a custom exception of type MissingFieldValueException? Choose 2 answers Throw (MissingFieldValueException,'Problem occurred'); Throw new MissingFieldValueException('Problem occurred'); Throw new MissingFieldValueException(); Throw Exception(new MissingFieldValueException());.
Given the code block: Integer x; for (x=0;x<10;x+=2) { if(x==8) break; if(x==10) break; } system.debug(x); Which value will the system.debug statement display? 4 2 10 8.
Which three statements are accurate about variable scope? Choose 3 answers Parallel blocks can reuse the same variable name A sub-block can reuse a parent block's variable name if it is static A variable can be declarated at any point in a block A variable must be declared before it can be referenced in a block A sub-block can reuse a parent block's variable name if it is not static.
To which primitive data type is a Text Area (rich) field automatically assigned? Text Blob Object String.
Which three methods help ensure quality data? Create a lookup filter Adding an error to a field in before trigger Sending an email alert using a workflow rule Handling an exception in Apex Adding a validation rule.
Which standard field is required when creating a new contact record? LastName Name AccountId FirstName.
From which 2 locations can a developer determine the overall code coverage for a sandbox? The test suite run panel of the developer console The apex classes setup page The apex test execution page The tests tab of the developer console.
A visualforce page uses the contact standard controller. How can a developer display the name from the parent account record on the page? Use SOQL syntax to find the related accounts name field Use the {!contact.account.name} merge field syntax Use an additional standard controller for accounts Use additional apex logic within the controller to query for the name field.
Which data type or collection of data types can SOQL statements populate or evaluate to? Choose 3 answers A Boolean An Integer A List of sObjects A Single sObject String.
Which type of code represents the view in the MVC architecture on the Force.com platform? An apex method in an extension that returns a list of cases An apex method that executes SOQL to retrieve a list of cases A Visualforce page that displays information about case records by iterating over a list of cases Validation rules for a page layout that includes a related list of cases.
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 (x < 20 ){ x = 'C'; } else { x = 'D'; } B C D A.
What is the data type returned by the following SOSL search? {FIND 'Acme*' in name fields returning Account, Opportunity}; List<List<Account>, List<Opportunity> Map<sObject, sObject> Map<Id, sObject> List<List<sObject>>.
A developer runs the following anonymous code block in a Salesforce org with 100 accounts List acc = [SELECT Id FROM Account LIMIT 10]; delete acc; database.emptyrecyclebin(acc); system.debug(limits.getlimitqueries()+' ,'+Limits.getlimitDMLStatements()); What is the debug output? 1, 2 10, 2 100, 150 150, 100.
A developer needs to save a list of existing account records named myaccounts to the database, but the records do not contain salesforce id values. Only the value of a custom test field configured as an external id with name of foreign_key__c is know. which two statement enable the developer to save the records to the database without an id Database.upsert(myaccount, foreign_key__c); Database.upsert(myaccount).foreign_key__c; Upsert myaccounts(foreign_key__c); Upsert myaccounts foreign_key__c;.
A developer is notified that a text field is being automatically populated with invalid values. However, this should be prevented by a custom validation rule that is in place what could be causing this? The field is being populated by a workflow field update A DML exception is occuring during the save order of execution The field is being populated by a before trigger The user belongs to a permission set that suppresses the validation rule.
On which object can an administrator create a roll-up summary field? Any object that is on the master side of a master-detail relationship. Any object that is on the parent side of a lookup relationship. Any object that is on the detail side of a master-detail relationship. Any object that is on the child side of a lookup relationship.
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? Create an Account formula field that displays the Task information. Nothing. The Task is automatically displayed on the Account page. Create a Workflow Rule to relate the Task to the Contact's Account. Nothing. The Task cannot be related to an Account and a Contact.
A developer is creating an enhancement to an application that will allow people to be related to their employer. Which data model provides the simplest solution to meet the requirements? Create a lookup realtionship to indicate that a person has an employer Create a master-detail relationship to indicate that a person has an employer Create a junction object to relate many people to many through master-detail relationship Create a junction object to relate many people to many through lookup relationship.
Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities? String qryname = String.escapesinglequotes(name); string qrystring = 'select id from contact where name like \'%'+ qryname + '%\''; list<contact> queryresult = database.query(qrystring); String qryname = '%' + string.enforcesecuritychecks(name) + '%'; string qrystring = 'select id from contact where name like :qryname'; list<contact> queryresult = database.query(qrystring); String qryname = '%'+name+'%'; string qrystring = 'select id from contact where name like :qryame'; list <contact> queryresult = database.query(qrystring); String qrystring = 'select id from contact where name like \'%'+name+'%\''; list<contact> queryresult = database.query(qrystring);.
Potential home buyers working with a real estate company can make offers on multiple properties that are listed with the real estate company. Offer amounts can be modified; however, the property that has the offer cannot be modified after the offer is place. What should be done to associate offers with properties in the schema for the organization? Create a master-detail relationship in the contact object to both the property and offer custom objects Create a lookup relationship in the property custom object to the offer custom object Create a master-detail relationship in the offer custom object to the property custom object Create a lookup relationship in the offer custom object to the property custom object.
What are two benefits of the lightning component framework? Choose 2 answers It provides an event-driven architecture for better decoupling between components It allows faster pdf generation with lightning components It simplifies complexity when building pages, but not applications It promotes faster development using out-of-the-box components that are suitable for desktop and mobile devices.
What is the debug output of the following apex code? Decimal thevalue; System.debug(thevalue); Undefined 0 Null 0.0.
Given the code below, what can be done so that recordCount can be accessed by a test class, but not by a non-test class? public class MyController { private integer recordCount; } Add a seeAllData annotation to the test class Add the testvisible annotation to recordСount Change recordCount from private to public Add the testvisible annotation to the mycontroller class.
An apex trigger fails because it exceeds governor limits. Which two techniques should a developer use to resolve the problem? Choose 2 answers Use the database class to handle DML operations Use maps to reference related records Use SOQL aggregate queries to retrieve child records Use lists for all DML operations.
How can a developer set up a debug log on a specific user? Set up a trace flag for the user, and define a logging level and time period for the trace Ask the user for access to their account credentials, log in as the user and debug the issue Create apex code that logs code actions into a custom object It is not possible to setup debug logs for users other than yourself.
A developer needs to update an unrelated object when a record gets save. Which two trigger types should the developer create? After insert After update Before update Before insert.
What can used to delete components from production? A change set deployment with the delete option checked An ant migration tool deployment with destructivechanges xml file and the components to delete in the package .xml file A change set deployment with a destructivechanges XML file An ant migration tool deployment with a destructivechanges XML file and an empty package .xml file.
Given the code below, which three statements can be used to create the controller variable? public class accountlistcontroller { public list<account> getaccounts() { return controller.getrecords(); } } Choose 3 answers Apexpages.StandardSetController controller = new Apexpages.StandardSetController(Database.getQueryLocator('select id from account')); Apexpages.StandardController controller = new Apexpages.StandardController([select id from account]); Apexpages.StandardController controller = new Apexpages.StandardController(Database.getQueryLocator('select id from account')); Apexpages.StandardSetController controller = new Apexpages.StandardSetController(Database.query('select id from account')); Apexpages.StandardSetController controller = new Apexpages.StandardSetController(Database.getQueryLocator([select id from account]));.
Which three statements are true regarding the @istest annotation? Choose 3 answers Products and pricebooks are visible in a test even if a class is annotated @istest (seealldata=false) A method annotated @istest (seealldata=false) in a class annotated @istest (seealladata=true) has access to all org data A method annotated @istest (seealldata=true) in a class annotated @istest (seealladata=false) has access to all org data Profiles are visible in a test even if a class is annotated @istest (seealldata=false) A class containing test methods counts toward the apex code limit regardless of any @istest annotation.
Candidates are reviewed by four separate reviewers and their comments and scores which range from 1 (lowest) to 5 (highest) are stored on a review record that is a detail record for a candidate. What is the best way to indicate that a combined review score of 15 of better is required to recommend that the candidate come in for an interview? Use a validation rule on a total score field on the candidate record that prevents a recommended field fomr being true if the total score is less than 15 Use a workflow rule to calculate the sum of the review scores and send an email to the hiring manager when the total is 15 or better Use visual workflow to set a recommended field on the candidate whenever the cumulative review score is 15 or better Use a rollup summary field to calculates the sum of the review scores, and store this in a total score field on the candidate.
A developer needs to include a visualforce page in the detail section of a page layout for the account object, but does not see the page as an available option in the page layout editor. Which attribute must the developer include in the <apex:page> tag to ensure the visualforce page can be embedded in a page layout Controller="account" Extensions="accountcontroller" Standardcontroller="account" Action="accountid".
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? An apex trigger that uses an aggregate query to calculate the hours for a given timecard and stores it in a custom field A visualforce page that calculates the total number of hours for a timecard and dispalys it on the page A process builder process that updates a field on the timecard when a timecard entry is created A roll-up summary field on the timecard object that calculates the total hours from timecard entries for that timecard.
What is the key difference between a master-detail realationship and a lookup relationship? When a record of a master object in a lookup relationship is deleted, the detail records are always deleted When a record of a master object in a master-detail relationship is deleted, the detail records are kept and not deleted A lookup relationship is a required field on an object A master-detail relationship detail record inherits the sharing and security of its master record.
A platform developer needs to write an apex method that will only perform an action if a record is assigned to a specific record typWhich two options allow the developer to dynamically determine the ID of the required record type by its name? Choose 2 answers Use the getRecordTypeInfosByDeveloperName() method in the DescribesObjectResult class Make an outbound web services call to the SOAP API Execute a SOQL query on the RecordType object Hardcore the ID as a constant in an apex class.
A developer created a visualforce page using a custom controller that calls an apex helper class. A method in the helper class hits a governor limit. What is the result of the transaction? The helper class creates a savepoint and continues All changes in the transaction are rolled back All changes made by the custom controller are saved The custom controller calls the helper class method again.
Which statement is true about a hierarchical relationship as it pertains to user records? It uses a junction object and lookup relationships to allow many user records to be related to many other user records It uses a junction object and master-detail relationship to allow many user records to be related to many other user records It uses a master-detail relationship to allow one user record to be related to another user record It uses a special lookup relationship to allow one user record to be related to another user record.
A developer created a visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page. What should the developer do to deploy to production? Create a test page that provides coverage of the custom controller Create a test page that provides coverage of the visualforce page Create a test class that provides coverage of the visualforce page Create a test class that provides coverage of the custom controller.
Which three data types can be returned from an SOQL statement? Boolean List of sObjects String Integer Single sObject.
In order to override a standard action with a visualforce page, which attribute must be defined in the <apex:page> tag? PageReference Override StandardController Controller.
What is a benefit of using a trigger framework? Simplifies addition of context-specific logic Allows functional code to be tested by a test class Increases trigger governor limits Reduces trigger execution time.
What are three techniques that a developer can use to invoke an anonymous block of code? Choose 3 answers Create a visualforce page that uses a controller class that is declared without sharing Type code into the developer console and execute it directly Type code into the execute anonymous tab in the force.com IDE and click execute Use the SOAP API to make a call to execute anonymous code Create and execute a test method that does not specify a runAs() call.
What are two characteristics of partial copy sandboxes versus full sandboxes? Choose 2 answers Includes a subset of metadata Requires a sandbox template Supports more frequent refreshes Provides more data record storage.
Which 2 statements are true about apex code executed in anonymous blocks? Choose 2 answers The code runs with the permissions of the logged in user The code runs with the permissions of the user specified in the runAs() statement The code runs in system mode having access to all objects and fields Successful DML operations are automatically committed All DML operations are automatically rolled back.
An after trigger on the account object performs a DML update operation on all of the child opportunities of an account. There are no active triggers on the opportunity object, yet a "maximum trigger depth exceeded" error occurs in certain situation. Which two reasons possibly explain the account trigger firing recursively? Choose 2 answers Changes are being made to the account during criteria based sharing evaluation Changes are being made to the account during an unrelated parallel save operation Changes to opportunities are causing cross-object workflow field updates to be made on the account Changes to opportunities are causing roll-up summary fields to update on the account.
Which control statement should a developer use to ensure that a loop body executes at least once? for (variable : list_or_set) { } while (condition) { } for (init_stmt; exit_cond;i ncrement) { } do { } while (cond).
A developer wrote the following after insert trigger to create a follow-up task whenever a new task is created: List<Task> followuptasks = new List<Task>(); for (Task thetask : trigger.new) { Task newtask = new Task ( Status = 'new', Priority='normal'); newtsk.Activitydate = Date.today().adddays(30); followuptasks.add(newtask); } insert followuptasks; What happens after the code block executes? Trigger fails if the Task subject is blank A new Task is created for each Task in trigger.new The trigger enters an infinite loop and eventually fails Multiple tasks are created for each task in trigger.new.
What is a capability of a StandardSetController? Choose 2 answers It extends the functionality of a standard or custom controller It allows pages to perform mass updates of records. It allows pages to perform pagination with large record sets. It enforces field-level security when reading large record sets.
A developer needs to import customer subscription records into salesforce and attach them to existing account records. Which 2 actions should the developer take to ensure the subscription records are related to the correct account records? Choose 2 answers Match an external ID text field to a column in the imported file Match an auto-number field to a column in the imported file Match the name field to a column in the imported file Match the id field to a column in the imported file.
A developer is asked to create a custom visualforce page that will be used as a dashboard component. Which three are valid controller options for this page? Choose 3 answers Use a custom controller Use a custom controller with extensions Use a standard controller with extensions Do not specify a controller Use a standard controller.
A developer needs to apply the look and feel of lightning experience to a number of applications built using a custom third-party javascript framework and rendered in visualforce pages which option achieves this? Set the attribute enablelightning to "true" in the definition Replace the third-party javascript library with native visualforce tags Configure the user interface options in the setup menu to enable legacy mode for visualforce Incorporate salesforce lightning design system css stylesheets into the javascript applications.
The account object has a custom percent field, rating, defined with a length of 2 with 0 decimal places. An account record has the value of 50% in its rating field and is processed in the apex code below after being retrieved from the database with SOQL public void processaccount() { Decimal acctscore = acc.rating__c * 100; } what is the value of acctscore after this code executes? 5 50 500 5000.
A developer can use the debug log to see which three types of information? Choose 3 answers Resource usage and limits Database changes User login events HTTP callout to external systems Actions triggered by time-based workflow.
Which feature allows a developer to create test records for use in test classes? Static resources Documents HttpCalloutMocks WebServiceTests.
Why would a developer use test.starttest() and test.stoptest()? To avoid apex code coverage requirements for the code between these lines To start and stop anonymous block execution when executing anonymous apex code To indicate test code so that it does not impact apex line count governor limits To create an additional set of governor limits during the execution of a single test class.
What is an accurate constructor for a custom controller named MyContactListController? Public MyContactListController (ApexPages.StandardController stdcontroller) { Account a = (Account) stdcontroller.getrecord(); contacts = a.contacts; } Public MyContactListController (ApexPages.StandardSetController stdcontroller) { contacts = (list) stdsetcontroller.getrecords(); } Public MyContactListController (List records) { contacts = (List) records; } Public MyContactListController () { contacts = new List (); }.
Which three statements are true regarding cross-object formulas? Choose 3 answers Cross-object formulas can reference fields from master-detail or lookup relantionships Cross-object formulas can reference fields from objects that are up to 10 relantionship away Cross-object formulas can expose data the user does not have access to in a record Cross-object formulas can reference child fields to perform an average Cross-object formulas can be referenced in roll-up summary field.
Which governor limit applies to all the code in an apex transaction? Elapsed CPU time Number of new records created Number of classes called Elapsed SOQL query time.
Which action can a developer take to reduce the execution time of the following code? List<Account> allaccounts = [select id from account]; List<Account> allcontacts = [select id, accountid from contact]; for (account a : allaccounts) { for (contact c:allcontacts) { if (c.accountid = a.id) { //do work } } } Use a Map<Id, Contact> for allaccounts Add a GROUP BY clause to the contact SOQL Put the account loop inside the contact loop Create an apex helper class for the SOQL.
A platform developer needs to implement a declarative solution that will display the most recent closed won date for all opportunity records associated with an account. Which field is required to achieve this declaratively? Roll-up summary field on the opportunity object Cross-object formula field on the account object Roll-up summary field on the account object Cross-object formula field on the opportunity object.
A developer has javascript code that needs to be called by controller functions in multiple components by extending a new abstract component. Which resource in the abstract component bundle allows the developer to achieve this? Controller.js Superrender.js Rendered.js Helper.js.
Which two automation tools include a graphical designer? Choose 2 answers Approvals Flow builder Process builder Workflows.
A developer needs to automatically populate the Reports To field in a Contact record on the values of the related Account and Department fields in the Contact record. Which type of trigger would the developer create? Choose 2 answers Before update After update Before insert After update.
How can a developer get all of the available record types for the current user on the case object? Use SOQL to get all cases Use DescribeSObjectEesult of the Case object Use Case.getRecordTypes() Use DescribeFieldResult of the Case.RecordType field.
To which data type in Apex a currency field automatically assigned? Integer Decimal Double Currency.
Which type of code represents the Controller in MVC architecture on the Force.com platform? Choose 2 answers. JavaScript that is used to make a menu item display itself StandardController system methods that are referenced by Visualforce Custom Apex and JavaScript code that is used to manipulate data. A static resource that contains CSS and images.
Which action can a developer perform in a before update trigger? Choose 2 answers Update the original object using an update DML operation Delete the original object using a delete DML operation Change field values using the Trigger.new context variable Display a custom error message in the application interface.
How should the developer overcome this problem? While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard Pricebook since one already exist in the org. Use @IsTest(SeeAllData=true) and delete the existing standard Pricebook. Use @TestVisible to allow the test method to see the standard Pricebook. Use Test.getStandardPricebookId()to get the standard Pricebook ID. Use Test.loaddata() and a Static Resource to load a standard Pricebook.
How can a developer avoid exceeding governor limits when using an Apex Trigger? Choose 2 answers. By using a helper class that can be invoked from multiple triggers. By using the Database class to handle DML transactions. By using Maps to hold data from query results. By performing DML transactions on lists of sObjects.
A developer runs the following anonymous code block: List<Account> acc = [select id from Account limit 10]; delete acc; Database.emptyRecycleBin(acc); System.debug(Limits.getDMLStatements() + ‘, ’ + Limits.getLimitDMLStatements()); What is the result? 11, 150 150, 2 150, 11 2, 150.
Which tool can deploy destructive changes to apex classes in production? Workbench Salesforce setup Change sets Developer Console.
Which type of controller should a developer use to include a list of related records for a custom object record on a visualforce page without needing additional test coverage? Custom Controller List Controller Controller Extension Standard Controller.
A change set deployment from a sandbox to production fails due to a failure in a managed package unit test. The developer spoke with the managed package owner and they determined it is false positive and can be ignore. What should the developer do to successfully deploy? Edit the managed package’s unit test Select “Fast Deploy” to run only the tests that are in the change set Select “Run local tests” to run only the tests that are in the change set Select “Run local tests” to run all tests in the org that are not in the managed package.
Which two condition cause workflow rules to fire? Choose 2 answers Changing territory assignments of accounts and opportunities Updating record using bulk API Converting leads to person account An Apex batch process that changes field values.
A company has a custom object named Region. Each account in salesforce can only be related to one region at a time, but this relationship is optional. Which type of relantionship should a developer use to relate an account to a region? Parent-child Master-detail Hierarchical Lookup.
A developer needs to find information about @future methods that were invoked. From which system monitoring feature can the developer see this information? Scheduled jobs Background jobs Asyncronous jobs Apex jobs.
How can a developer warn users of SOQL governor limit violations in a trigger? Use PageReference.SetRedirect() to redirect the user to a custom visualforce page before the number of SOQL queries exceeds the limit Use ApexMessage.Message() to display an error message after the number of SOQL queries exceeds the limit Use Messagging.SendEmail() to continue the transaction and send an alert to the user after the number of SOQL queries exceeds the limit Use Limits.getQueries() and display an error message before the number of SOQL queries exceeds the limit.
Which statement about change set deployments is accurate? Choose 3 answers They can be used only between related organizations They require a deployment connection They use an all or none deployment model They can be used to transfer Contact records They can be used to deploy custom settings data.
How would a developer use Schema Builder to delete a custom field from the Account object that was required for prototyping but is no longer needed? Remove all the references in the code and then the field will be removed from Schema Builder. Remove all references from the code and then delete the custom field from Schema Builder. Mark the field for deletion in Schema Builder and then delete it from the declarative UI. Delete the field from Schema Builder and then all references in the code will be removed.
What is an accurate statement about variable scope? Choose 3 answers Sub-blocks cannot reuse a parent block's variable name. A variable can be defined at any point in a block. Parallel blocks can use the same variable name. Sub-blocks can reuse a parent block's variable name if its value is null. A static variable can restrict the scope to the current block if its value is null.
When the value of a field in an account record is updated, which method will update the value of custom field related opportunities? Choose 2 answers An Apex trigger on the Account object. A Process Builder on the Account object. A cross-object formula field on the Account object. A Workflow Rule on the Account object.
Which declarative process automation feature supports iterating over multiple records? Flows Workflow rules Approval process Validation rules.
Which option should a developer use to create 500 accounts and make sure that duplicate are not created for existing account sites? Data Import Wizard Sandbox template Data Loader Salesforce-To-Salesforce.
Manage package can be created in which type of org? Partial copy sandbox Unlimited edition Developer Edition Developer sandbox.
Which two ways can a developer instantiate a PageRefence in Apex? By using an object standard set controller action By using an object standard controller action By using the PageReference.getUrl() method By using ApexPages.CurrentPage().
How many level of child records can be returned in a single SOQL query from one parent object? 1 3 5 7.
Which two statement are acceptable for a developer to use Inside procedural loops? Contactlist.remove(i) Delete contactList Account a = [select id, name from Account where id = :con.accountid limit 1] Contact con = new Contact().
A developer wants to store a description of a product that can be entered on separate lines by a user during product setup and later displayed on a visualforce page for shopper. Which field type should the developer choose to ensure that the description will be searchable in the custom apex SOQL queries that are written? Text Text area (rich) Text area (long) Text area.
A developer declared a class as follow public class wysiwyg { //properties and methods includin DML } Which invocation of a class method will obey the organization-wide defaults and sharing settings for the running user in the salesforce organization? A developer using the developer console that invokes a method in this class from the execute anonymous window An apex trigger that invokes a helper method in this class A visualforce page with an apex controller that invokes a method in this class A user on an external system that has an API call into salesforce that invokes a method in this calls.
What is considered the primary purpose for creating apex tests? To ensure every use case of the application is covered by a test To quarantee at least 50% of code is covered by unit tests before it is deployed To confirm every trigger is executed at least once To confirmal classes and triggers compile successfully.
A developer uses a test setup method to create an account named 'test'. The first method deletes the account record. What must be done in the second test method to use the account? Use select id from Account where name = 'test' Restore the account using an undelete statement Call the test setup method at the start of the test The account cannot be used in the second method.
Which is a valid apex assignment? Integer x=5 * 1.0 Integer = 5.0 Double x = 5 Float x = 5.0.
Requirements state that a child record be deleted when its parent is deleted, and a child can be moved to a different parent when necessary. Which type of relationship should be built between the parent and child objects in schema builder to support these requirements? Master-detail relationship Lookup relationship from the parent to the child Child relationship Lookup relationship from the child to the parent.
How can a developer use Set<Id> to limit the number of records returned by a soql query? Pass the set as an argument in a reference to the database.query() method Reference the set in the WHERE clause of the query Reference the set in the LIMIT clause of query Pass the query results as an argument in a reference to the Set.containsAll() method.
The account object has a custom formula field, level__c, that is defined as formula (number) with two places. Which three are valid assignments? Choose 3 answers Double mylevel = acct.level__c Decimal mylevel = acct.level__c Object mylevel = acct.level__c Long mylevel = acct.level__c Integer mylevel = acct.level__c.
A developer wants to display all of the picklist entries for the opportunity StageNamefield and all of the available record types for the opportunity object on a visualforce page. Which two actions should the developer perform to get the available picklist values and record types in the controller? Choose 2 answers Use Schema.RecordTypeInfo returned by RecordType.SObjectType.getDescribe().getRecordTypeInfos() Use Schema.PicklistEntry returned by Opportunity.StageName.getDescribe().getPicklistValue() Use Schema.PicklistEntry returned by Opportunity.SObjectType.getDescribe().getPicklistValue() Use Schema.RecordTypeInfo returned by Opportunity.SObjectType.getDescribe().getRecordTypeInfos().
A developer wants to handle the click event for a lightning:button componentthe onclick attribute for the component references a javascript function in which resource in the component bundle? Helper.js Handler.js Renderer.js Controller.js.
Which statement is true about developing in a multi-tenant environment? Governor limits prevent apex from impaction the performance of multiple tenants on the same instance Apex sharing controls access to records form multiple tenants on the same instance Global apex classes can be referenced from multiple tenants on the same instance Org-level data security controls which users can see data from multiple tenants on the same instance.
Which two roll-up summary field types are required to find the average of values on detail records in a master-detail relationship? Choose 2 answers Roll-up summary field of type SUM Roll-up summary field of type NUM Roll-up summary field of type TOTAL Roll-up summary field of type COUNT.
A developer creates a custom controller and custom visualforce page by using the code block below public class mycontroller { public string mystring { get { if (mystring == null) { mystring = 'a'; } return mystring; } public string getmystring() { return 'getmystring'; } public string getstringmethod() { if (mystring == null) { mystring='b'; } return mystring; } } <apex:page controller="mycontroller"> {!stringmethod},{!mystring},{!mystring} </apex:page> What can the user expect to see when accessing the custom page? b,a,getmystring a,b,b a,a,a a,b,getmystring.
Which two approaches optimize test maintenance and support future declarative configuration changes? Choose 2 answers Create a method that performs a callout for valid records, then call this method within test methods Create a method that load valid account records from a static resource, then call this method within test method Create a method that creates valid records, then call this method within test methods Create a method that queries for valid records, then call this method within methods.
Which two statements are true regarding formula fields? Choose 2 answers When concatenating fields, line breaks can be added to improve readability Formula fields may reference formula fields on the same object to a level of one deep When using the & operator to concatenate strings, the result is automatically truncated to fit the destination Fields that are referenced by a formula field can not be deleted until the formula is modified or deleted.
A developer uses an after update trigger on the Account object to update all the contacts related to the account. The trigger code shown below is randomly failing List<Contact> theContacts = new List<Contact>(); for (Account a : trigger.new) { for (Contact c: [select id, account_date__c from contact where accountid = :a.id]) { c.account_date__c = date.today(); theContacts.add(c); } } update theContacts; Which line of code is causing the code block to fail? 08:an exception is throw if theContacts is empty 04: an exception is throw if account_date__c is null 03: a soql query is located inside of the for loop 02: the trigger processes more than 200 records in the for loop.
Which type of code represents the model in the MVC architecture on the Force.com platform? A controller extension method that saves a list of account records A list of account records returned from a controller extension method Custom javascript that processes a list of accountrecords A controller extension method that uses soql to query for a list of account records.
Opportunity opp = [select Id, StageName from Opportunity limit 1] Given the code above, how can a developer get the label for the StageName field? Call "opp.StageName.getDescribe().getLabel()" Call "Opportunity.StageName.Label" Call "Opportunity.StageName.getDescribe().getLabel()" Call "opp.StageName.Label".
Which two SOSL searches will return records matching search criteria contained in any of the searchable text fields on an object? Choose 2 answers [FIND 'acme*' IN ANY FIELDS RETURNING Account, Opportunity] [FIND 'acme*' RETURNING Account, Opportunity] [FIND 'acme*' IN ALL FIELDS RETURNING Account, Opportunity] [FIND 'acme*' IN TEXT FIELDS RETURNING Account, Opportunity].
Which two components are available to deploy using the metadata api? Choose 2 answers Web-to-Case Case settings Web-to-Lead Lead conversion settings.
A developer has the following class and trigger code public class InsuranceRates { public static final decimal smokerCharge = 0.01; } trigger ContactTrigger on Contact (before insert) { InsuranceRates rates = new InsuranceRates(); decimal basecost = xxx; } Which code segment should a developer insert at the xxx to set the basecost variable to the value of the class variable smokercharge? rates.smokerCharge ContacttTigger.InsuranceRates.smokerCharge InsuranceRates.smokerCharge rates.getSmokerCharge().
A company wants to create an employee rating program that allows employees to rate each other. An employee's average rating must be displayed on the employee record. Employees must be able to create rating records, but are not allowed to create employee records. Which two actions should a developer take to accomplish this task? Choose 2 answers Create a master-detail relanstionship between the Rating and Employee object Create a trigger on the rating object that updates a field on the Employee object Create a roll-up sumary field on the employee and use AVG to calculate the average rating score Create a lookup realntionship between the Rating and Employee object.
Which two practices should be used for processing records in a trigger? Choose 2 answers Use @future methods to handle DML operations Use (callout=true) to update an external system Use a set to ensure unique values in a query filter Use a map to reduce the number of SOQL calls.
A developer needs to provide a way to mass edit, update and delete records from a list view. In which two ways can this be accomlpished? Choose 2 answers Download an unmanaged package from the AppExchange that provides customizable mass edit, update and delete functionality Configure the user interface and enable both inline editing enhanced lists Download a managed package from the AppExchange that provides customizable enhanced list views and buttons Create a new visualforce page and apex controller for the list view that provides mass edit, update and delete functionality.
A developer needs to create an audit trail for records that are sent to the recycle bin. Which type of trigger is most appropriate to create? After undelete Before undelete Before delete After delete.
An account trigger updates all related contacts and cases each time an account is saved using the following two DML statements update allcontacts update allcases What is the result if the case update exceeds the governor limit for maximum number of DML records? The account save succeeds, contacts are updated but cases are not The account save fails and no contacts or cases are updated The account save is retried using a smaller trigger batch size The account save succeeds and no contacts or cases are updated.
A developer needs an apex method that can process account or contacts records. Which method signature should the developer use? Public void dowork(account || contact) Public void dowork(account contact) Public void dowork(Record theRecord) Public void dowork(SObject theRecord).
A developer needs to create a custom visualforce button for the Opportunity object page layout that will cause a web service to be called and redirect the user to a new page when clicked. Which three attributes need to be defined in the <apx:page> tag of the visualforce page to enable this functionality? StandardController Extensions Action Readonly RenderAs.
The sales team at universal container would like to see a visual indicator appear on both Account and Opportunity page layout to alert sales people when an account is late making payments or has entered the collections process. What can a developer implement to achieve this requirement without having to write custom code? Workflow rule Formula field Roll-up summary field Quick action.
Which tag should a developer include when styling from external css is required in a visualforce page? apex:includescript apex:stylesheet apex:includestyles apex:require.
For which example task should a developer use a trigger rather than a workflow rule? To set the primary Contact on an Account record when it is saved To notify an external system that a record has been modified To set the name field of an expense report record to expense and the date when it is saved To send an email to a hiring manager when a candidate accepts a job offer.
An apex transaction inserts 100 account records and 2000 contact records before encountering a DML exception when attempting to insert 500 opportunity records.The account records are inserted by calling the database.insert() method with the allOrNone argument set to false. The contact and opportunity records are inserted using the standalone insert statement. How many total records will be committed to the database in this transaction? 0 100 2100 2000.
When a task is created for a contact, how can a developer prevent the task from being included on the activity timeline of the contact's account record? In activity settings, uncheck roll-up activities to a contact's primary account By default, tasks do not display on the account activity timeline Use process builder to create a process to set the task account field to blank Create a task trigger to set the account field to NULL.
A developer wants to use all of the functionality provided by the standard controller for an aobject, but needs to override the save standard action in a controller extension. Which two are required in the controller extension class? Choose 2 answers Create a method named save with a return data type of PageReference Define the class with a constructor that creates a new instance of the standardcontroller class Create a method that references this.supersave() Define the class with a constructor that takes an instance of standardcontroller as a parameter.
In the code below, which type does String inherit from? String s = 'Hello World'; Object SObject Prototype Class.
Which scenario is invalid for execution by unit tests? Executing methods for negative test scenarios. Executing methods as different users. Loading test data in place of user input for Flows. Load the standard Pricebook ID using a system method.
A developer runs the following anonymous code block: List<Account> acc = [SELECT Id FROM Account LIMIT 10]; delete acc; Database.emptyRecycleBin(acc); system.debug(Limits.getDMLStatements() + ', ' + Limits.getLimitDMLStatements()); What is the result? 11, 150 150, 2 150, 11 2, 150.
Report abuse Consent Terms of use