New platform developer I

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

A developer uses a loop to check each Contact in a list. When a Contact with the Title of "Boss" is found, the Apex method should jump to the first line of code outside of the for loop. Which Apex solution will let the developer implement this requirement? A. break; B. Continue C. Next D. Exit

A

A developer needs to confirm that a Contact trigger works correctly without changing the organization's data. what should the developer do to test the Contact trigger? A. Use the New button on the Salesforce Contacts Tab to create a new Contact record. B. Use the Open execute Anonymous feature on the Developer Console to run an 'insert Contact' DML statement C. Use Deploy from the VSCode IDE to display an 'insert Contact' Apex class. D. Use the Test menu on the Developer Console to run all test classes for the Contact trigger

D

A developer wants to mark each Account in a List<Account> as either or Inactive based on the LastModified field value being more than 90 days. Which Apex technique should the developer use? A. A for loop, with a switch statement inside B. A Switch statement, with a for loop inside C. An If/else statement, with a for loop inside D. A for loop, with an if/else statement inside

D

An Apex method, getAccounts, that returns a List of Accounts given a search Term, is available for Lighting Web components to use. What is the correct definition of a Lighting Web component property that uses the getAccounts method? A. @AuraEnabled(getAccounts, '$searchTerm') accountList; B. @wire(getAccounts, '$searchTerm') accountList; C. @AuraEnabled(getAccounts, {searchTerm: '$searchTerm'}) accountList; D. @wire(getAccounts, {searchTerm: '$searchTerm'}) accountList;

D

A developer needs to implement the functionality for a service agent to gather multiple pieces of information from a customer in order to send a replacement credit card. Which automation tool meets these requirements?

Flow Builder

Which action may cause triggers to fire? A. Updates to Feed Items B. Renaming or replacing a picklist entry C. Changing a user's default division when the transfer division option it checked D. Cascading delete operations

Answer A

A Salesforce developer wants to review their code changes immediately and does not want to install anything on their computer or on the org. Which tool is best suited? A. Developer Console B. Salesforce Extension for VSCode C. Setup Menu D. Third-party apps from App Exchange

Answer: A

A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public class customCtrlr{ private Account theAccount; public String actType; public customCtrlr() { theAccount = [SELECT Id, Type FROM Account WHERE Id = :apexPages.currentPage().getParameters().get('id')]; actType = theAccount.Type; } } Visualforce page snippet: The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is property referenced on the Visualforce page, what should the developer do to correct the problem? A. Add a getter method for the actType attribute. B. Change theAccount attribute to public. C. Convert theAccount.Type to a String. D. Add with sharing to the custom controller.

Answer: A

A developer has the following requirements: Calculate the total amount on an Order. Calculate the line amount for each Line Item based on quantity selected and price. Move Line Items to a different Order if a Line Item is not stock. Which relationship implementation supports these requirements? A. Line Items has a Master-Detail field to Order and the Master can be re-parented. B. Line Item has a Lookup field to Order and there can be many Line Items per Order C. Order has a Lookup field to Line Item and there can be many Line Items per Order. D. Order has a Master-Detail field to Line Item and there can be many Line Items per Order.

Answer: A

A developer is asked to create a Visualforce page for Opportunities that allows users to save or merge the current record. Which approach should the developer to meet this requirement? A. A custom controller B. A custom controller extension C. Visualforce page JavaScript D. Standard controller methods

Answer: A

A developer must create a lightning component that allows users to input contact record information to create a contact record, including a salary__c custom field. what should the developer use, along with a lightning-record-edit form, so that salary__c field functions as a currency input and is only viewable and editable by users that have the correct field levelpermissions on salary__C? A. <ligthning-input-field field-name="Salary__c"> </lightning-input-field> B. <lightning-formatted-number value="Salary__c" format-style="currency"> </lightning-formatted-number> C. <lightning-input type="number" value="Salary__c" formatter="currency"> </lightning-input> D. <lightning-input-currency value="Salary__c"> </lightning-input-currency>

Answer: A

A developer must provide a custom user interface when users edit a Contact. Users must be able to use the interface in Salesforce Classic and Lightning Experience. What should the developer do to provide the custom user interface? A. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. B. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning page inLightning Experience. C. Override the Contact's Edit button with a Lightning component in Salesforce Classic and a Lightning component in Lightning Experience. D. Override the Contact's Edit button with a Lightning page in Salesforce Classic and a Visualforce page in Lightning Experience.

Answer: A

A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of test allowing them to test independent requirements various types of Salesforce Cases. Which approach can efficiently generate the required data for each unit test? A. Use @TestSetup with a viod method. B. Create test data before Test.startTest() in the unit test. C. Add @isTest(seeAllData=true) at the start of the unit test class. D. Create a nock using the Stud API

Answer: A

An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web components to use. What is the correct definition of a Lightning Web component property that uses the getAccounts method? A. wire (getAccounts, ( searchTerm: "SearchTerm' accountList; B. @AuraEnabled (getAccounts, "$searchTerm' ) accountlist; C)@AuraEnabled (getAccounts, ( searchTerm: 'SsearchTerm' accountList; D. wire (getAccounts, SsearchTerm') accountList;

Answer: A

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 text field configured as an External ID with an API name of Foreign_Key__c is known. Which two statements enable the developer to save the records to the database without an Id? (Choose two.) A. Upsert myAccounts Foreign_Key__c; B. Upsert myAccounts(Foreign_Key__c); C. Database.upsert (myAccounts, Foreign_Key__c); D. Database.upsert(myAccounts).Foreign_Key__c;

Answer: A C

Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool? A. Use the schema describe calls to determine if the logged-in users has access to the Account object. B. Use the without sharing keyword on the class declaration. C. Use the UserInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user. D. Use the with sharing keyword on the class declaration.

Answer: D

A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console? A. The test method has a syntax error in the code. B. The test method relies on existing data in the sandbox. C. The test method is calling an @future method. D. The test method does not use System.runAs to execute as a specific user.

Answer: B

A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations. Which type of Salesforce orgs should they use for their development? A. Developer sandboxes B. Scratch orgs C. Full Copy sandboxes D. Developer orgs

Answer: B

An org has an existing Visual Flow that creates an Opportunity with an Update records element. A developer must update the Visual Flow also created a Contact and store the created Contact's ID on the Opportunity. A. Add a new Get Records element. B. Add a new Create records element. C. Add a new Quick Action (of type create) element. D. Add a new Update records element

Answer: B

Given the following block code: try{ List <Accounts> retrievedRecords = [SELECT Id FROM Account WHERE Website = null]; } catch(Exception e){ //manage exception logic } What should a developer do to ensure the code execution is disrupted if the retrievedRecordslist remains empty after the SOQL query? A. Check the state of the retrieveRecords variable and throw a custom exception if the variable is empty. B. Check the state of the retrievedRecords variable and use System.assert(false) if the variable is empty C. Check the state of the retrievedRecords variable and access the first element of the list if the variable is empty. D. Replace the retrievedRecords variable declaration from ftount to a single Account.

Answer: B

Universal Containers stores the availability date on each Line Item of an Order and Orders are only shipped when all of the Line Items are available. Which method should be used to calculate the estimated ship date for an Order? A. Use a CEILING formula on each of the Latest availability date fields. B. Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order. C. Use a LATEST formula on each of the latest availability date fields. D. Use a Max Roll-Up Summary field on the Latest availability date fields.

Answer: D

Universal Containers wants to back up all of the data and attachments in its Salesforce org once month. Which approach should a developer use to meet this requirement? A. Use the Data Loader command line. B. Create a Schedulable Apex class. C. Schedule a report. D. Define a Data Export scheduled job.

Answer: D

Which Apex class contains methods to return the amount of resources that have been used for a particular governor, such as the number of DML statements? A. Exception B. Messaging C. OrgLimits D. Limits

Answer: D

Which aspect of Apex programming is limited due to multitenancy? A. The number of active Apex classes B. The number of methods in an Apex Class C. The number of records processed in a loop D. The number of records returned from database queries

Answer: D

Which exception type cannot be caught ? A. CalloutException B. A custom Exception C. NoAccessException D. LimitException

Answer: D

Which salesforce org has a complete duplicate copy of the production org including data and configuration? A. Developer Pro Sandbox B. Partial Copy Sandbox C. Production D. Full Sandbox

Answer: D

A developer needs to have records with specific field values in order to test a new Apex class. What should the developer do to ensure the data is available to the test? A. Use Anonymous Apex to create the required data. B. Use SOQL to query the org for the required data. C. Use Test.Loaddata () and reference a static resource. D. Use Test.Loaddata () and reference a CSV file

Answer:C

As a part of class implementation a developer must execute a SOQL query against a large data ser based on the contact object. The method implementation is as follows. Which two methods are best practice to implement heap size control for the above code? (Choose 2 Answers) A. Use the FOR UPDATE option on the SOQL query to lock down the records retrieved. B. Use visual keyword when declaring the retrieve variable. C. Use a SOQL FOR loop, to chunk the result set in batches of 200 records. D. Use WHERE clauses on the SOQL query to reduce the number of records retrieved.

Answer: B C

Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation. What are two characteristics of declarative development over programmatic customization? Choose 2 answers A. Declarative development has higher design limits and query limits. B. Declarative development can be done using the Setup UI. C. Declarative development does not require Apex test classes. D. Declarative code logic does not require maintenance or review.

Answer: B C

What are two ways that a controller and extension can be specified on a Visualforce page? Choose 2 answers A. a@pex:page=Account extends="myControllerExtension" B. apex:page standardController="Account"extensions="myControllerExtension" C. apex:page controllers="Account, myControllerExtension" D. apex:page controller="Account" extensions="myControllerExtension""

Answer: B D

Which two statements are true about using the @testSetup annotation in an Apex test class? Choose 2 answers A. Records created in the test setup method cannot be updated in individual test methods. B. The @testSetup annotation is not supported when the GisTest(SeeAllData=True) annotation is used. C. Test data is inserted once for all test methods in a class. D. A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits.

Answer: B D

A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple subjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL. Which three statements are useful inside the unit test to effectively test the custom controller? Choose 3 answers A. insert pageRef. B. Test.setCurrentPage(pageRef); C. public ExtendedController(ApexPages StandardController cntrl) { } D. ApexPages.CurrentPage().getParameters().put('input\', 'TestValue'); E. String nextPage - controller.save().getUrl();

Answer: B D E

A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of new Apex helper class. Change Set deployment to production fails with the test coverage warning: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required" What should the developer do to successfully deploy the new Apex trigger and helper class? A. Create a test class and methods to cover the Apex trigger B. Run the tests using the 'Run All Tests' method. C. Remove the falling test methods from the test class. D. Increase the test class coverage on the helper class

Answer: C

A developer has an integer variable called maxAttempts. The developer meeds to ensure that once maxAttempts is initialized, it preserves its value for the lenght of the Apex transaction; while being able to share the variable's state between trigger executions. How should the developer declare maxAttempts to meet these requirements? A. Declare maxattempts as a member variable on the trigger definition. B. Declare maxattempts as a private static variable on a helper class C. Declare maxattempts as a constant using the static and final keywords D. Declare maxattempts as a variable on a helper class

Answer: C

A developer must build application that tracks which Accounts have purchase specific pieces of equal products. Each Account could purchase many pieces of equipment. How should the developer track that an Account has purchased a piece of equipment. A. Use the Asset object. B. Use a Custom object. C. Use a Master-Detail on Product to Account D. Use a Lookup on Account to product.

Answer: C

A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability? A. ApexPages.currentPage() .getParameters() .get('url_param') B. ApexPages.currentPage() .getParameters() .get('url_param') .escapeHtml4() C. String.ValueOf(ApexPages.currentPage() .getParameters() .get('url_param')) D. String.escapeSingleQuotes(ApexPages.currentPage() .getParameters(). get('url_param'))

Answer: D

A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org. Which tool should the developer use to troubleshoot? A. AppExchange B. Salesforce CLI C. Visual Studio Core IDE D. Developer Console

Answer: D

A recursive transaction is limited by a DML statement creating records for these two objects: 1. Accounts 2. Contacts The Account trigger hits a stack depth of 16. Which statement is true regarding the outcome of the transaction? A. The transaction fails only if the Contact trigger stack depth is greater or equal to 16. B. The transaction succeeds as long as the Contact trigger stack depth is less than 16. C. The transaction fails and all the changes are rolled back. D. The transaction succeeds and all the changes are committed to the database.

Answer: D

Given the code below: What should a developer do to correct the code so that there is no chance of hitting a governor limit? A. Rework the code and eliminate the for loop. B. combine the two SELECT statements into a single SOQL statement. C. Add a WHERE clause to the first SELECT SOQL statement. D. Add a LIMIT clause to the first SELECT SOQL statement.

Answer: D

What are three capabilities of the <ltng : require> tag when loading JavaScript resources in Aura components? Choose 3 answers A. Loading files from Documents B. One-time loading for duplicate scripts C. Specifying loading order D. Loading scripts In parallel E. Loading externally hosted scripts

BCD

Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required? A. Asynchronous Data Capture Events B. Developer Log C. Event Monitoring Log D. Calendar Events

C

An org tracks customer orders on an Order object and the items of an Order on the Line Item object. The Line Item object has a MasterDetail relationship to the order object. A developer has a requirement to calculate the order amount on an Order and the line amount on each Line item based on quantity and price. What is the correct implementation? A. Implement the line amount as a numeric formula field and the order amount as a roll-up summary field. B. Write a single before trigger on the Line Item that calculates the item amount and updates the order amount on the Order. C. Implement the Line amount as a currency field and the order amount as a SUM formula field. D. Write a process on the Line item that calculates the item amount and order amount and updates the filed on the Line Item and the order.

Answer: A

Application Events follow the traditional publish-subscribe model. Which method is used to fire an event? A. Fire() B. Emit() C. RegisterEvent() D. FireEvent()

Answer: A

How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i < 500; i++) { Account a = new Account(Name='New Account ' + i); insert a; } 0 Boolean odk; Integer x; if(abok=false;integer=x;){ X=1; }elseif(abok=true;integer=x;){ X=2; }elseif(abok!=null;integer=x;){ X=3; )elseif{ X=4;} A. X=4 B. X=8 C. X=9 D. X=10

Answer: A

The values 'High', 'Medium', and 'Low' are Identified as common values for multiple picklist across different object. What is an approach a developer can take to streamline maintenance of the picklist and their values, while also restricting the values to the ones mentioned above? A. Create the Picklist on each object and use a Global Picklist Value Set containing the Values. B. Create the Picklist on each object as a required field and select "Display values alphabeticaly, not in the order entered". C. Create the Picklist on each object and select "Restrict picklist to the values defined in the value set". D. Create the Picklist on each and add a validation rule to ensure data integrity.

Answer: A

Which Lightning code segment should be written to declare dependencies on a Lightning component, c:accountList, that is used in a Visualforce page? <Aura: application access="Global" extends="itng :outapp">

Answer: A

Which process automation should be used to send an outbound message without using Apex code? A. Workflow Rule B. Process Builder C. Approval Process D. Flow Builder

Answer: A

Which standard field is required when creating a new contact record? A. LastName B. Name C. AccountId D. FirstName

Answer: A

Which statement is true about developing in a multi-tenant environment? A. Governor limits prevent apex from impacting the performance of multiple tenants on the same instance B. Apex sharing controls access to records form multiple tenants on the same instance C. Global apex classes can be referenced from multiple tenants on the same instance D. Org-level data security controls which users can see data from multiple tenants on the same instance

Answer: A

what are the three languages used in the visualforce page? A. Javascript, CSS, HTML B. Apex, Json, SQL C. C++, C,CSS

Answer: A

A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Whithin the class, the developer identifies the following method as a security threat: List<Contact> performSearch(String lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%); } What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers A. Use variable binding and replace the dynamic query with a static SOQL. B. Use the escapeSingleQuote method to sanitize the parameter before its use. C. Use a regular expression on the parameter to remove special characters. D. Use the @Readonly annotation and the with sharing keyword on the class.

Answer: A B

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 situations. Which two reasons possibly explain the Account trigger firing recursively? (Choose two.) A. Changes to Opportunities are causing cross-object workflow field updates to be made on the Account. B. Changes to Opportunities are causing roll-up summary fields to update on the Account. C. Changes are being made to the Account during an unrelated parallel save operation. D. Changes are being made to the Account during Criteria Based Sharing evaluation.

Answer: A B

If apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which statement are true regarding governor limits? Choose 2 answers A. The Apex governor limits might be higher due to the asynchronous nature of the transaction. B. The apex governor limits are reset for each iteration of the execute() mrthod. C. The Apex governor limits are relaxed while calling the costructor of the Apex class. D. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction,

Answer: A B

Which two events need to happen when deploying to a production org? Choose 2 answers A. All triggers must have at least 1% test coverage. B. All Apex code must have at least 75% test coverage. C. All triggers must have at least 75% test coverage. D. All test and triggers must have at least 75% test coverage combined

Answer: A B

A developer wants to invoke on outbound message when a record meets a specific criteria. Which three features satisfy this use case? Choose 3 answer A. Approval Process has the capacity to check the record criteria and send an outbound message without Apex Code B. Process builder can be used to check the record criteria and send an outbound message with Apex Code. C. workflows can be used to check the record criteria and send an outbound message. D. Process builder can be used to check the record criteria and send an outbound messagewithout Apex Code. E. Visual Workflow can be used to check the record criteria and send an outbound message without Apex Code.

Answer: A B C

Which three operations affect the number of times a trigger can fire? Choose 3 answers A. Process Flows B. Workflow Rules C. Criteria-based Sharing calculations D. Email messages E. Roll-Up Summary fields

Answer: A B E

Which two statements are accurate regarding Apex classes and interfaces? Choose 2 answers A. Classes are final by default. B. Inner classes are public by default. C. Interface methods are public by default. D. A top-level class can only have one inner class level.

Answer: C D

Universal Containers recently transitioned from Classic to Lighting Experience. One of its business processes requires certain value from the opportunity object to be sent via HTTP REST callout to its external order management system based on a user-initiated action on the opportunity page. Example values are as follow Name Amount Account Which two methods should the developer implement to fulfill the business requirement? (Choose 2 answers) A. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page. B. Create a Process Builder on the Opportunity object that executes an Apex immediate action to perform the HTTP REST callout whenever the Opportunity is updated. C. Create an after update trigger on the Opportunity object that calls a helper method using @Future(Callout=true) to perform the HTTP REST callout. D. Create a Visualforce page that performs the HTTP REST callout, and use a Visualforce quick action to expose the component on the Opportunity detail page.

Answer: A C

Which two are best practices when it comes to component and application event handling? (Choose two.) A. Reuse the event logic in a component bundle, by putting the logic in the helper. B. Use component events to communicate actions that should be handled at the application level. C. Handle low-level events in the event handler and re-fire them as higher-level events. D. Try to use application events as opposed to component events.

Answer: A C

Which two statements accurately represent the MVC framework implementation in Salesforce? Choose 2 answers A. Validation rules enforce business rules and represent the Controller (C) part of the MVC framework B. Lightning component HTML files represent the Model (M) part of the MVC framework. C. Triggers that create records represent the Model (M) part of the MVC framework. D. Standard and Custom objects used in the app schema represent the View (V) part of the MVC framework

Answer: A C

Universal Containers decides to use exclusively declarative development to build out a new Salesforce application. Which three options should be used to build out the database layer for the application? Choose 3 answers A. Roll-Up Summaries B. Triggers C. Relationships D. Process Builder E. Custom Objects and Fields

Answer: A C D

What are three techniques that a developer can use to invoke an anonymous block of code? (Choose three.) A. Use the SOAP API to make a call to execute anonymous code. B. Create a Visualforce page that uses a controller class that is declared without sharing. C. Run code using the Anonymous Apex feature of the Developer's IDE. D. Type code into the Developer Console and execute it directly. E. Create and execute a test method that does not specify a runAs() call.

Answer: A C D

Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers A. $Lightning.createComponent B. <apex:slds/> C. $Lightning.useComponent D. $Lightning.use E. <apex:includeLightning/>

Answer: A D E

A Next Best Action strategy uses an Enhance Element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors. What is the correct definition of the Apex method? A. @InvocableMethod global static ListRecommendation getLevel(List<ContactWrapper> input) { /*implementation*/ } B. @InvocableMethod global static List<List<Recommendation>> getLevel(List<ContactWrapper> input) { /*implementation*/ } C. @InvocableMethod global List<List<Recommendation>> getLevel(List<ContactWrapper> input) { /*implementation*/ } D. @InvocableMethod global Recommendation getLevel (ContactWrapper input) { /*implementation*/ }

Answer: B

A custom picklist field, Food_Preference__c, exist on a custom object. The picklist contains the following options: 'Vegan','Kosher','No Preference'. The developer must ensure a value is populated every time a record is created or updated. What is the most efficient way to ensure a value is selected every time a record is saved? A. Set "Use the first value in the list as the default value" as True. B. Set a validation rule to enforce a value is selected. C. Mark the field as Required on the field definition. D. Mark the field as Required on the object's page layout.

Answer: B

A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violation to the user. How can the developer make sure that validation rule violations are displayed? A. Add cuatom controller attributes to display the message. B. Include <apex:message> on the Visualforce page. C. Use a try/catch with a custom exception class. D. Perform the DML using the Database.upsert() method.

Answer: B

A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what defined for payments in the PaymentProcessor interface. public interface PaymentProcessor { void pay(Decimal amount); } Which is the correct implementation to use the PaymentProcessor interface class? A. Public class CheckPaymentProcessor implements PaymentProcessor { public void pay(Decimal amount) {} } B. Public class CheckPaymentProcessor implements PaymentProcessor { public void pay(Decimal amount); } C. Public class CheckPaymentProcessor extends PaymentProcessor { public void pay(Decimal amount); } D. Public class CheckPaymentProcessor extends PaymentProcessor { public void pay(Decimal amount) {} }

Answer: B

A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use? A. Public void doWork(Record theRecord) B. Public void doWork(sObject theRecord) C. Public void doWork(Account Contact) D. Public void doWork(Account || Contatc)

Answer: B

A developer needs to prevent the creation of request records when certain conditions exist in the system. A RequestLogic class exists to checks the conditions. What is the correct implementation? A. Trigger RequestTrigger on Request (after insert) { RequestLogic.validateRecords {trigger.new}; } B. Trigger RequestTrigger on Request (before insert) { RequestLogic.validateRecords {trigger.new}; } C. Trigger RequestTrigger on Request (before insert) { if (RequestLogic.isvalid{Request}) Request.addError {'Your request cannot be created at this time.'}; } D. Trigger RequestTrigger on Request (after insert) { if (RequestLogic.isValid{Request}) Request.addError {'Your request cannot be created at this time.'}; }

Answer: B

For which three items can a trace flag be configured? Choose 3 answers A. Process Builder B. Visualforce C. Apex Class D. Apex Trigger E. User

Answer: C D E

Given the following trigger implementation: trigger leadTrigger on Lead (before update){ final ID BUSINESS_RECORDTYPEID = '012500000009Qad'; for(Lead thisLead : Trigger.new){ if(thisLead.Company != null && thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){ thisLead.RecordTypeId = BUSINESS_RECORDTYPEID; } } The developer receives deployment errors every time a deployment is attempted from Sandbox to Production. What should the developer do to ensure a successful deployment? A. Ensure BUSINESS_RECORDTYPEID is retrieved using Schema.Describe calls. B. Ensure a record type with an ID of BUSINESS_RECORDTYPEID exists on Production prior to deployment. C. Ensure BUSINESS_RECORDTYPEID is pushed as part of the deployment components. D. Ensure the deployment is validated by a System Admin user on Production.

Answer: B

How can a developer check the test coverage of active Process Builder and Flows deploying them in a Changing Set? A. Use the Flow properties page. B. Use the code Coverage Setup page C. Use the Apex testresult class D. Use SOQL and the Tooling API

Answer: B

How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i < 500; i++) { Account a = new Account(Name='New Account ' + i); insert a; } A. 150 B. 0 C. 500 D. 100

Answer: B

In the Lightning UI, where should a developer look to find information about a Paused Flow Interview? A. On the Paused Row Interviews related List for a given record B. In the Paused Interviews section of the Apex Rex Queue C. In the system debug log by Altering on Paused Row Interview D. On the Paused Row Interviews component on the Home page

Answer: B

Universal Container(UC) wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The Developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called "Global Address". Which field should the developer ad to create the most efficient model that supports the business need? A. Add a Master-Detail field on the Account object to the Global Address object B. Add a Master-Detail field on the Global Address object to the Account object. C. Add a Lookup field on the Account object to the Global Address object. D. Add a Lookup field on the Global Address object to the Account object

Answer: B

Universal Containers (UC) decided it will not to send emails to support personnel directly from Salesforce in the event that an unhandled exception occurs. Instead, UC wants an external system be notified of the error. What is the appropriate publish/subscribe logic to meet these requirements? A. Publish the error event using the addError() method and have the external system subscribe to the event using CometD. B. Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using CometD. C. Have the external system subscribe to the BatchApexError event, no publishing is necessary. D. Publish the error event using the addError() method and write a trigger to subscribe to the event and notify the external system.

Answer: B

What can used to delete components from production? A. A change set deployment with the delete option checked B. An ant migration tool deployment with destructivechanges xml file and the components to delete in the package .xml file C. A change set deployment with a destructivechanges XML file D. An ant migration tool deployment with a destructivechanges XML file and an empty package .xml file

Answer: B

What does the Lightning Component framework provide to developers? A. Extended governor limits for applications B. Prebuilt component that can be reused. C. Templates to create custom components. D. Support for Classic and Lightning UIS.

Answer: B

What should a developer do to check the code coverage of a class after running all tests? A. View the Code Coverage column in the view on the Apex Classes page. B. View the Class test Coverage tab on the Apex Class record. C. view the overall Code Coverage panel of the tab in the Developer Console. D. Select and run the class on the Apex Test Execution page

Answer: B

When a user edits the Postal Code on an Account, a custom Account text field named "Timezone" must be update based on the values in a PostalCodeToTimezone__c custom object. How should a developer implement this feature? A. Build an Account Assignment Rule. B. Build an Account custom Trigger C. Build an account Approval Process D. Build an Account Workflow Rule.

Answer: B

When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs? A. Production B. Dev Hub C. Environment Hub D. Sandbox

Answer: B

Which code in a Visualforce page and/or controller might present a security vulnerability? A. <apex:outputField value="{!ctrl.userInput}" /> B. <apex:outputText escape="false" value=" {!$CurrentPage.parameters.userInput}" /> C. <apex:outputText value="{!£CurrentPage.parameters.userInput}" /> D. <apex:outputField escape="false" value="{!ctrl.userInput}" />

Answer: B

Which scenario is valid for execution by unit tests? A. Load data from a remote site with a callout. 5. Set the created date of a record using a system method. Cc: Execute anonymous Apex as a different user. B. Generate a Visualforce PDF with geccontentAsPDF ().

Answer: B

When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs? A. Production B. Dev Hub C. Environment Hub D. Sandbox

Answer: B Explanation https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm

A developer has a VF page and custom controller to save Account records. The developer wants to display any validation rule violation to the user. How can the developer make sure that validation rule violations are displayed? A. Add custom controller attributes to display the message. B. Include <apex:messages> on the Visualforce page. C. Use a try/catch with a custom exception class. D. Perform the DML using the Database.upsert() method

Answer: B Explanation https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_message.htm

A developer considers the following snippet of code: Based on this code, what is the value of x? Boolean isoK: integer Xi String thestring = 'Hello' if (isOK =e false ad thestring 'Hello") f X = 1: } else if (isOK == true && thestring == X = 2: 1 else if (isOK != null && thestring y = 3: } else y = 4: A. 2 B. 1 C. 3 D. 4

Answer: D

A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to Include helper methods that are not used by the Web Application In the Implementation of the Web Service Class. Which code segment shows the correct declaration of the class and methods? Which code segment shows the correct declaration of the class and methods? A) global class WebServiceClass| private Boolean helperMethod()( /+ implementation global String updateRecords() /* implementation B) webservice class WebServiceClass private Boolean helperMethod{} { /* implementation global static String updateRecords{} {/* implementation */] C) global class WebServiceClass{ private Boolean helperMethod{} /* implementation */} webservice static String updateRecords() { /* implementation */7 D) webservice class WebServiceClass private Boolean helperMethod() { { /* implementation ... */ } webservice statis String updateRecords(} { /* implementation . */ 7 A. Option A B. Option B C. Option C D. Option D

Answer: C

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 a custom field on the child object of type Foreign Key B. Create and populate a custom field on the parent object marked as Unique 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 External Relationship.

Answer: C

A primaryid_c custom field exists on the candidate_c custom object. The filed is used to store each candidate's id number and is marked as Unique in the schema definition. As part of a data enrichment process. Universal Containers has a CSV file that contains updated data for all candidates in the system, f he file contains each Candidate's primary id as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system. Which technique should the developer implement to streamline the data upload? A. Create a Process Builder on the Candidate_c object to map the records. B. Create a before Insert trigger to correctly map the records. C. A Update the primaryid__c field definition to mark it as an External Id D. Upload the CSV into a custom object related to Candidate_c.

Answer: C

How should a developer write unit tests for a private method in an Apex class? A. Use the SeeAllData annotation. B. Add a test method in the Apex class. C. Use the TestVisible annotation. D. Mark the Apex class as global.

Answer: C

Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order will be imported into Salesforce. A. Lookup B. Direct Lookup C. Number with External ID D. Indirect Lookup

Answer: C

Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records. which Visualforce feature supports this requirement? A. <apex:listButton> tag B. Custom controller C. RecordSetVar page attribute D. Controller extension

Answer: C

What is an example of a polymorphic lookup field in Salesforce? A. The LeadId and Contactid fields on the standard Campaign Member object B. A custom field, Link__c, on the standard Contact object that looks up to an Account or a Campaign C. The Whatld field on the standard Event object D. The Parentid field on the standard Account object

Answer: C

What is the result of the following code? A. The record will not be created and a exception will be thrown. B. The record will be created and a message will be in the debug log. C. The record will not be created and no error will be reported. D. The record will be created and no error will be reported.

Answer: C

What will be the output in the debug log in the event of a QueryExeption during a call to the @query method in the following Example? class myclass class CustomException extends QueryException(1 public static Account aQuery () ( Account theAccount; try f system.debug ('Querying Accounts. "); theAccount = (SELECT Id FROM Account WHERE CreatedDate > TODAY]: catch (CustomException eX) system. debug ('Custom Exception."): ) catch (QueryException ex) | system.debug (' Query Exception."); ) finally " system.debug ('Done.") ; return theAccount; A. Querying Accounts. Query Exception. B. Querying Accounts. Custom Exception. C. Querying Accounts. Query Exception. Done D. Querying Accounts. Custom Exception Done.

Answer: C

Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required? A. Asynchronous Data Capture Events B. Developer Log C. Event Monitoring Log D. Calendar Events

Answer: C

Refer to the following code snippet for an environment has more than 200 Accounts belonging to the Technology' industry: When the code execution, which two events occur as a result of the Apex transaction? When the code executes, which two events occur as a result of the Apex transaction? Choose 2 answers A. If executed in an asynchronous context, the apex transaction is likely to fall by exceeding the DML governor limit B. The Apex transaction succeeds regardless of any uncaught exception and all processed accounts are updated. C. The Apex transaction fails with the following message. "SObject row was retrieved via SOQL without querying the requested field Account.Is.Tech__c''. D. If executed In a synchronous context, the apex transaction is likely to fall by exceeding the DHL governor limit.

Answer: C , A

A developer identifies the following triggers on the Expense_c object: DeleteExpense, applyDefaultstoexpense validateexpenseupdate; The triggers process before delete, before insert, and before update events respectively. Which two techniques should the developer implement to ensure trigger best practice are followed? A. Unify the before insert and before update triggers and use Process Builder for the delete action. B. Maintain all three triggers on the Expense__c object, but move the Apex logic out for the trigger definition. C. Create helper classes to execute the appropriate logic when a record is saved. D. Unify all three triggers in a single trigger on the Expense__c object that includes all events.

Answer: C D

A developer needs to update an unrelated object when a record gets saved. Which two trigger types should the developer create? A. After insert B. After update C. Before update D. Before insert

Answer: C D

A developer is creating a page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default } | Opportunity record type, and set certain default values based on the record type before inserting the record. i, J Calculator How can the developer find the current user's default record type? A. Query the Profile where the ID equals userInfo.getProfileID() and then use the profile.Opportunity.getDefaultRecordType() | | method. ] | B. o Use Opportunity. SObjectType.getDescribe().getRecordTypelnfos() to get a list of record types, and iterate through them until [ J isDefaultRecordTypeMapping() is true. Pencil & Paper | C. Use the Schema.userlnfo.Opportunity.getDefaultRecordType() method. < Create the opportunity and check the opportunity.recordType before inserting, which will have the record ID of the current Dal user's default record type.

B


Set pelajaran terkait

psych 220 wakefulness and sleep & internal regulation

View Set

Chapter 35: Structure and Function of the Pulmonary System

View Set

PHP Programming with MySQL: chapter 3

View Set

Topic D3-Install and Configure RAID

View Set

BIO 201: Chapter 2 Anatomy of a Representative Cell

View Set