pd1st3
![]() |
![]() |
![]() |
Title of test:![]() pd1st3 Description: pd1st3 test for test |




New Comment |
---|
NO RECORDS |
60 of 60. Which three resources in an Aura component can contain JavaScript functions?. Renderer. Design. Controller. Style. Helper. 59 of 60. A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of Apex tests allowing them to test isolated requirements for various types of Salesforce cases. Which approach can efficiently generate the required data for each unit test?. Use @TestSetup with a void method. Create test data before Test.startTest() in the unit test. Add @isTest(seeAllData=true) at the start of the unit test class. Create a nock using the Stud API. Flow Builder uses an Apex action to provide additional information about multiple Contacts, stored in a custom class, Contact Info. Which is the correct definition of the Apex method that gets the additional information?. A. @InvocableMethod(Label='additional Info') public ContactInfo(Id contactId) { /*implementation*/ }. B. @InvocableMethod(label='Additional Info') public List<ContactInfo> getInfo(List<Id> contactIds) { /*implementation*/ }. C. @invocableMethod(label)='Additional Info') public static List<ContactInfo> getInfo(List<Id> contactIds) { /*Implementation*/ }. D. @InvocableMethod(label='additional Info') public static ContactInfo getInfo(Id contactId) { /*implementation*/ }. A team of many developers work in their own individual orgs that have the same configuration as the production org. Which type of org is best suited for this scenario?. Developer Sandbox. Developer Edition. Full Sandbox. Partner Developer Edition. A developer has an integer variable called maxAttempts. The developer needs to ensure that once maxAttempts is initialized, it preserves its value for the length 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?. Declare maxAttempts as a private static variable on a helper class. Declare maxAttempts as a variable on a helper class. Declare maxAttempts as a member variable on the trigger definition. Declare maxAttempts as a constant using the static and final keywords. Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1,000,000. A developer created the following trigger on the Account object to satisfy this requirement. Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, It fails with system. Exception errors. Which two actions should the developer take to fix the code segment shown above? Choose 2 answers. Move the DML that saves opportunities outside the for loop. Query for existing opportunities outside the for loop. Check if all the required fields for Opportunity are being added on creation. Use Database.query to query the opportunities. 54 of 60. Which exception type cannot be caught?. LimitException. NoAccessException. A Custom Exception. CalloutException. 53 of 60. Which code statement includes an Apex method named updateAccounts in the class AccountController for use in a Lightning web component?. import updateAccounts from 'AccountController';. import updateAccounts from ‘@salesforce/apex/AccountController.updateAccounts';. import updateAccounts from 'AccountController.updateAccounts';. import updateAccounts from ‘@salesforce/apex/AccountController’;. 52 of 60. Where are two locations a developer can look to find information about the status of batch or future methods?. Apex Jobs. Apex Flex Queue. Developer Console. Paused Flow Interviews component. 51 of 60. Cloud Kicks has a multi-screen flow that its call center agents use when handling inbound service desk calls. At one of the steps in the flow, the agents should be presented with a list of order numbers and dates that are retrieved from an external order management system in real time and displayed on the screen. What should a developer use to satisfy this requirement?. An outbound message. An invocable method. An Apex controller. An Apex REST class. Which action causes a before trigger to fire by default for Accounts?. Updating addresses using the Mass Address update tool. Importing data using the Data Loader and the Bulk API. Renaming or replacing picklist. Converting Leads to Contact accounts. What is a capability of the <ltng:require> tag that is used for loading external Javascript libraries in Lightning Component? (Choose three.). Loading files from Documents. One-time loading for duplicate scripts. Specifying loading order. Loading scripts in parallel. Loading externally hosted scripts. 48 of 60. 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?. Limits. Messaging. OrgLimits. Exception. 47 of 60. Which three statements are accurate about debug logs? Choose 3. Debug log levels are cumulative, where FINE log level includes all events logged at the DEBUG, INFO, WARN, and ERROR levels. The maximum size of a debug log is 5 MB. Only the 20 most recent debug logs for a user are kept. Debug logs can be set for specific users, classes, and triggers. System debug logs are retained for 24 hours. When a user edits the Postal Code on an Account, a custom Account text field named "Timezone" must be updated based on the values in another custom object called PostalCodeToTimezone__c. What is the optimal way to implement this feature? Choose 2 answers. Approval process. Fast field Updates record-triggered flow. Account trigger. Quick actions. 45 of 60. Which two operations affect the number of times a trigger can fire? Choose 2 answers. Criteria-based sharing calculations. After-save record-triggered flow. Roll-up summary fields. Email messages. A developer is tasked with building a custom Lightning web component to collect Contact information. The form will be shared among many different types of users in the org. There are security requirements that only certain fields should be edited and viewed by certain groups of users. What should the developer use in their Lightning Web Component to support the security requirements?. force-input-field. ui-input-field. aura-input-field. lightning-input-field. 43 of 60. An Opportunity needs to have an amount rolled up from a custom object that is not in a master-detail relationship. How can this be achieved?. Use the Metadata API to create real-time roll-up summaries. Write a trigger on the child object and use an aggregate function to sum the amount for all related child objects under the Opportunity. Use the Streaming API to create real-time roll-up summaries. Write a trigger on the Opportunity object and use tree sorting to sum the amount for all related child objects under the Opportunity. 42 of 60. A developer is working on a project to import data from an external system into Salesforce. The data contains sensitive information that should not be visible to all users in Salesforce. What should the developer do to ensure that the data is secure?. Use a third-party tool to encrypt the sensitive data before importing it into Salesforce. Use the Apex Data Loader to import the data and write Apex code to handle security and access control. Use the Data Import Wizard to import the data and set up field-level security to restrict access to sensitive fields. Use the Salesforce CLI to import the data and set up user permissions to restrict access to sensitive data. A developer created a child Lightning web component nested inside a parent Lightning web component. The parent component needs to pass a string value to the child component. In which two ways can this be accomplished? Choose 2. The parent component can use the Apex controller class to send data to the child component. The parent component can invoke a public method in the child component. The parent component can use a custom event to pass the data to the child component. The parent component can use a public property to pass the data to the child component. Universal Containers wants Opportunities to no longer be editable when it reaches the Closed/Won stage. Which two strategies can a developer use to accomplish this? Choose 2. Use an automatically launched Approval Process. Use a before-save Apex trigger. Use an auto-response rule. Use a validation rule. 39 of 60. Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order records will be imported into Salesforce. How should the Order Number field be defined in Salesforce?. Direct Lookup. External ID and Unique. Lookup. Indirect Lookup. Which code displays the contents of a Visualforce page as a PDF?. <apex:page contentType="pdf">. <apex:page rendersAs="application/pdf">. <apex:page contentType="application/pdf">. <apex:page renderAs="pdf">. 37 of 60. Which annotation exposes an Apex class as a RESTful web service?. @HttpInvocable. @RemoteAction. @RestResource (urlMapping="'/mySexrvice/*'). @AuraEnabled(cacheable=true). While working in a sandbox, an Apex test fails when run in the Test Runner. However, executing the Apex logic in the Execute Anonymous window succeeds with no exceptions or errors. Why did the method fail in the sandbox test framework but succeed in the Developer Console?. The test method does not use system, run as to execute as a specific user. The test method has a syntax error in the code. The test method is calling an @future method. The test method relies on existing data in the sandbox. What are two benefits of using declarative customizations over code? Choose 2 answers. Declarative customizations cannot generate run time errors. Declarative customizations generally require less maintenance. Declarative customizations automatically update with each Salesforce release. Declarative customizations automatically generate test classes. 34 of 60. 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?. Use Deploy from the VSCode IDE to deploy an 'insert Contact' Apex class. Use the New button on the Salesforce Contacts Tab to create a new Contact record. Use the Test menu on the Developer Console to run all test classes for the Contact trigger. Use the Open Execute Anonymous feature on the Developer Console to run an 'insert Contact DML statement. 33 of 60. A company has a custom object, Order_e, that has a required, unique external ID field called Order Number_c. Which statement should be used to perform the DML necessary to insert new records and update existing records in a list of Order_c records using the external ID field?. upsert orders;. upsert orders Order_Number__c;. merge orders Order_Number__c;. merge orders;. 32 of 60. A developer wants to send an outbound message when a record meets a specific criteria. Which two features satisfy this use case? Choose 2 answers. Flow Builder can be used to check the record criteria and send an outbound message. Entitlement Process can be used to check the record criteria and send an outbound message without Apex code. Approval Process can be used to check the record criteria and send an outbound message without Apex code. Next Best Action can be used to check the record criteria and send an outbound message. A custom picklist field, Food_Preference_c, exists 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 optimal way to ensure a value is selected every time a record is saved?. Write an Apex trigger to ensure a value is selected. Mark the field as Required on the field definition. Set "Use the first value in the list as the default value" to True. Mark the field as Required on the object's page layout. A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purposes. The following code is executed in the Developer Console using the Execute Anonymous window: Account myAccount new Account (Name insert myAccount; Integer x = 1; 'MyAccount'); List<Account> newAccounts = new List<Account>(); do { Account acct = new Account (Name= 'New Account + x++); newAccounts.add(acct); } while (x < 10); How many total accounts will be in the org after this code is executed?. 5. 6. 10. 15. 29 of 60. Universal Containers hires a developer to build a custom search page to help users find the Accounts they want. Users will be able to search on Name, Description, and a custom comments field. Which consideration should the developer be aware of when deciding between SOQL and SOSL? Choose 2 answers. SOSL is faster for text searches. SOQL is faster for text searches. SOSL is able to return more records. SOQL is able to return more records. Which scenario is valid for execution by unit tests?. Load data from a remote site with a callout. Execute anonymous Apex as a different user. Set the created date of a record using a system method. Generate a Visualforce PDF with getContentAsPDF(). A developer created this Apex trigger that calls MyClass.myStaticMethod: trigger myTrigger on Contact(before insert) { MyClass.myStaticMethod(trigger.new, trigger.oldMap); } The developer creates a test class with a test method that calls MyClass.myStaticMethod, resulting in 81% overall code coverage. What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exists?. The deployment passes because the Apex code has the required >75% code coverage. The deployment passes because both classes and the trigger were included in the deployment. The deployment fails because the Apex trigger has no code coverage. The deployment fails because no assertions were made in the test method. A developer needs to allow users to complete a form on an Account record that will create a record for a custom object. The form needs to display different fields depending on the user's job role. The functionality should only be available to a small group of users. Which three things should the developer do to satisfy these requirements? Choose 3. Create a Dynamic Form. Create a Custom Permission for the users. Add a Dynamic Action to the Users' assigned Page Layouts. Create a Lightning web component. Add a Dynamic Action to the Account Record Page. 25 of 60. A developer created a trigger on the Account object. While testing the trigger, the developer sees the error message 'Maximum trigger depth exceeded'. What could be the possible causes?. The trigger does not have sufficient code coverage. The developer does not have the correct user permission. . The trigger is too long and should be refactored into a helper class. The trigger is getting executed multiple times. 24 of 60. Universal Containers decides to use purely declarative development to build out a new Salesforce application. Which two options can be used to build out the business logic layer for this application? Choose 2. Remote Actions. Validation Rules. Batch Jobs. Record-Triggered Flow. Universal Containers needs to create a custom user interface component that allows users to enter information about their accounts. The component should be able to validate the user input before saving the information to the database. What is the best technology to create this component?. Flow. Lightning Web Components. Visualforce. VUE JavaScript framework. 22 of 60. Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?. List <sObject> searchList = (FIND '*ACME*' IN ALL FIELDS RETURNING Contact, Lead);. List<List <sObject>> searchList = (FIND '*ACME*' IN ALL FIELDS RETURNING Contact, Lead);. Map <sObject> searchList = (FIND '*ACME*' IN ALL FIELDS RETURNING Contact, Lead);. List<List < sObject>> searchList = (SELECT Name, ID FROM Contact, Lead WHERE Name like '%ACME%');. 21 of 60. What should be used to create scratch orgs?. Sandbox refresh. Workbench. Salesforce CLI. Developer Console. 20 of 60. A developer created these three Rollup Summary fields in the custom object, Project__c: total Timesheets c Total Approved Timesheets_c Total Rejected Timesheet_ The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project. Which should the developer use to implement the business requirement in order to minimize maintenance overhead?. Roll-up summary field. Formula field. Apex trigger. Record-triggered flow. What are three ways for a developer to execute tests in an org? Choose 3 answers. Tooling API. Bulk API. Setup Menu. Metadata API. Salesforce DX. A developer must create a CreditCardPayment class that provides an implementation of an existing Payment class. public virtual class Payment { public virtual void make Payment (Decimal amount) {/*implementation*/ }} Which is the correct implementation?. Public class CreditcardPayment extends Payment { public override void makePayment(Decimal amount) { /*implementation*/ } }. Public class CreditCardPayment implements Payment { public virtual void makePayment(Decimal amount) { /*implementation*/ } }. Public class CreditCardPayment extends Payment { public virtual void makePayment(Decimal amount) { /*implementation*/ } }. Public class CreditCardPayment implements Payment { public override void makePayment(Decimal amount) { /*Implementation*/ } }. 17 of 60. A developer is creating a Lightning web component to show a list of sales records. The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field. How should this be enforced so that the component works for both users without showing any errors?. Use Lightning Data Service to get the collection of sales records. Use WITH SECURITY_ENFORCED in the SOQL that fetches the data for the component. Use Lightning Locker Service to enforce sharing rules and field-level security. Use Security.stripInaccessible to remove fields inaccessible to the current user. 16 of 60. Universal Containers recently transitioned from Classic to Lightning Experience. One of its business processes requires certain values from the Opportunity object to be sent via an HTTP REST callout to its external order management system when the user presses a custom button on the Opportunity detail page. Example values are as follows: Name Amount • Account Which two methods should the developer implement to fulfill the business requirement? Choose 2. 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. 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. Create a Lightning component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page. Create an after update trigger on the Opportunity object that calls a helper method using @Future(Callout=true) to perform the HTTP REST callout. 15 of 60. A developer is implementing an Apex class for a financial system. Within the class, the variables 'creditAmount' and 'debitAmount' should not be able to change once a value is assigned. In which two ways can the developer declare the variables to ensure their value can only be assigned one time? Choose 2. Use the static keyword and assign its value in a static initializer. Use the final keyword and assign its value when declaring the variable. Use the final keyword and assign its value in the class constructor. Use the static keyword and assign its value in the class constructor. A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names. What two things should be done to create the test data within the unit test with the least amount of code? (Choose two.). Use the @isTest(seeAllData=true) annotation in the test class. Create a static resource containing test data. Use the @isTest(isParallel=true) annotation in the test class. Use Test.loadData to populate data in your test methods. 13 of 60. What are two use cases for executing Anonymous Apex code? Choose 2. To run a batch Apex class to update all Contacts. To schedule an Apex class to run periodically. To delete 15,000 inactive Accounts in a single transaction after a deployment. To add unit test code coverage to an org. Universal Containers has a support process that allows users to request support from its engineering team using a custom object, Engineering_Support__c. Users should be able to associate multiple Engineering_Support__c records to a single Opportunity record. Additionally, aggregate information about the Engineering_Support__c records should be shown on the Opportunity record. What should a developer implement to support these requirements?. Master-detail field from Opportunity to Engineering_Support__c. Lookup field from Engineering_Support__c to Opportunity. Lookup field from Opportunity to Engineering_Support__c. Master-detail field from Engineering_Support__c to Opportunity. 11 of 60. Which three Salesforce resources can be accessed from a Lightning web component? Choose 3 answers. Content asset files. Third-party web components. SVG resources. Static resources. All external libraries. 10 of 60. If Apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which two statements are true regarding governor limits? Choose 2 answers. The Apex governor limits will use the asynchronous limit levels. The Apex governor limits are reset for each iteration of the execute() method. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction. The Apex governor limits are omitted while calling the constructor of the Apex class. Which two settings must be defined in order to update a record of a junction object? Choose 2 answers. Read/Write access on the secondary relationship. Read/Write access on the primary relationship. Read/Write access on the junction object. Read access on the primary relationship. 8 of 60. A developer is integrating with a legacy on-premise SQL database. What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?. External Object. External ID field. Formula field. Lookup field. An org has an existing flow that edits an Opportunity with an Update Records element. A developer must update the flow to also create a Contact and store the created Contact's ID on the Opportunity. Which update must the developer make in the flow?. Add a new Get Records element. Add a new Roll Back Records element. Add a new Create Records element. Add a new Update Records element. 6 of 60. How is a controller and extension specified for a custom object named "Notice" on a Visualforce page?. apex:page=Notice extends="myControllerExtension". apex:page controller="Notice__c" extensions="myControllerExtension". apex:page controllers="Notice__c, myControllerExtension". apex:page standardController="Notice__c" extensions="myControllerExtension". A developer is creating an app that contains multiple Lightning web components. One of the child components is used for navigation purposes. When a user clicks a button called Next in the child component, the parent component must be alerted so it can navigate to the next page. How should this be accomplished?. Create a custorn event. Call a method in the Apex controller. Update a property on the parent. Fire a notification. 4 of 60. Refer to the following Apex code: Integer x = 0; do { x = 1; x++; ) while (x < 1); System.debug(x); What is the value of x when it is written to the debug log. 0. 1. 2. 3. A developer created a new after insert trigger on the Lead object that creates Task records for each Lead. After deploying to production, an existing outside integration that inserts Lead records in batches to Salesforce is occasionally reporting total batch failures being caused by the Task insert statement. This causes the integration process in the outside system to stop, requiring a manual restart. Which change should the developer make to allow the integration to continue when some records in a batch cause failures due to the Task insert statement, so that manual restarts are not needed?. Use a try-catch block after the insert statement. Remove the Apex class from the integration user's profile. Use the Database method with allorNone set to false. Deactivate the trigger before the integration runs. Which two events need to happen when deploying to a production org? Choose 2. All custom objects must have visibility set to a value other than in Development. All Apex code must have at least 75% test coverage. All triggers must have some test coverage. All Visual flows must have at least 1% test coverage. n the following example, which sharing context myMethod execute when it is invoked? public Class myClass { public void myMethod() { /* implementation */ } }. Sharing rules will not be enforced for the running user. Sharing rules will be inherited from the calling context. Sharing rules will be enforced for the running user. Sharing rules will be enforced by the instantiating class. |