AnacardoByKris2
|
|
Título del Test:
![]() AnacardoByKris2 Descripción: Anarcado By Cristian con K |



| Comentarios |
|---|
NO HAY REGISTROS |
|
What are two ways a developer can get the status of an enqueued job for a class that implements the queueable interface?. View the Apex Flex Queue. Query the AsyncApexJob object. View the Apex Jobs page. View the Apex Status page. 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?. Create an after update trigger on the Opportunity object that calls a REST method using @Future(Callout=true) to perform the HTTP Callout. Create a Lightning component quick action that perform the HTTP callout, and use a Lightning Action to expose the component on the Opportunity detail page. Create a Remote Action on the Opportunity object that executes an Apex immediate action to perform the HTTP Rest callout whenever the Opportunity is updated. Create a custom Visualforce quick action that performs the HTTP Rest callout, and use a Visualforce quick action to expose the component on the Opportunity detail page. A software company uses the following objects and relationships: - Case: to handle customer suppoort issues - Defect__c: a custom object to represent known issues with the company's software. - Case_Defect__c: a junction object between Case and Defect__c to represent that a defect is a cause of a customer issue. Case a Defect__c have Private organization-wide defaults. What should be done to share a specific Case_Defect__c record with a user?. Share the Case_Defect__c record. Share the parent Defect__c record. Share the parent Case record. Share the parent Case and Defect__c record. 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. How can the developer find the current user's default record type?. Use the Schema.userInfo.Opportunity.getDefaultRecordType() method. Create the opportunity and check the opportunity.recordType, which will have the record ID of the current user's default record type, before inserting. Use Opportunity.SObjectType.getDescribe().getRecordTypeInfos() to get a list of record types, and iterate through them until isDefaultRecordTypeMapping() is true. Query the Profile where the ID equals userInfo.getProfileID() and then use the profile.Opportunity.getDefaultRecordType() method. A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles. Which two tools can they use to run a script that deploys to a sandbox?. Change Sets. VSCode. Developer Console. SFDX CLI. Universal Containers wants to back up all of the data and attachments in its Salesforce org once a month. Which approach should a developer use to meet this requirements?. Use the Data Loader command line. Schedule a report. Define a Data Export scheduled job. Create a Schedulable Apex class. A developer is alerted to an issue with a custom Apex trigger that is causing record to be duplicated. What is the most appropiate debugging approach to troubleshoot the issue?. Disable the trigger in production and test to see if the issue stills occurs. Review the Historical Event logs to identify the source of the issue. Add system.debug statemets to the code to track the execution flow and identify the issue. Use the Apex Interactive Debugger to step through the code and identify the issue. Which two characteristics are true for Lightning Web Component custom events?. By default a custom event only propagates to its immediate container and to its immediate child component. By default a custom event only propagates to it's immediate container. Data may be passed in the payload of a custom event using a property called detail. Data may be passed in the payload of a custom event using @wire decorated properties. Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and its method, calculateBodyFat(). The product owner wants to ensure this method is accesible by the consumer of the application when developing customizations outside the ISV's package namespace. Which approach should a developer take to ensure calculateBodyFat() is accesible outside the package namespace?. Declare the class as global an duse the public access modifier on the method. Declare the class and method using the public access modifier. Declare the class and method using the global access modifier. Declare the class as public and use the global access modifier on the method. What should a developer do to check the code coverage of a class after running all tests?. View the Cass Test Percentage tab on the Apex Class list view in Salesforce Setup. Select and run the class on the Apex Test Execution page in the Developer Console. View the Code Coverage column in the list view on the Apex Classes page. View the code coverage percentage for the class using the Overall Code Coverage panel in the Developer Console Tests Tab. Consider the following code snippet for a Visualforce page that is launched using a Custom Button on the Account detail page layout. <apex:page standardController="Account"> <!-- additional UI elements --> <apex:commandButton action="{!save}" value="Save" /> </apex:page> When the Save button is presed the developer must perform a complex validation that involves multiple objects and, upon success, redirect the user to another Visualforce page. What can the developer use to meet this business requirement?. Validation rule. Apex trigger. Custom controller. Controller extension. Assuming that name is a String obtained by an <apex:inputText> tag on a Visualforce page, which two SOQL queries performed are safe from SOQL injection?. String query= '%' + name + '%' List<Account> results = [SELECT Id FROM Account WHERE Name Like :query]. String query = 'SELECT Id FROM Account WHERE Name LIKE \ '%' + name.noQuotes() + '%\''; List<Account> results = Database.query(query);. String query = 'SELECT Id From Account WHERE Name LIKE \'%' + name + '%\'';. String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + String.escapeSingleQuotes(name) + '%\'';. The OrderHelper class is a utility class that contains business logic for processing orders. Consider the following code snippet: public class without sharing orderHelper{ //code implementation } A developer needs to create a constant named DELIVERY_MULTIPLIER with a value of 4.15. The value of the constant should not change at any time in the code. How should the developer declare the DELIVERY_MULTIPLIER constant to meet the business objectives?. static final decimal DELIVERY_MULTIPLIER = 4.15;. static decimal DELIVERY_MULTIPLIER = 4.15;. Developers at Universal Containers (UC) use verison control to share their code changes, but they notice that when they deploy their code to different environmets they often have failures. They decide to set up Continuous Integration (CI). What should the UC development team use to automatically run tests as part of their CI process?. Force.com Toolkit. Vs Code. Salesforce CLI. Developer Console. A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL. insert pageRef;. Test.setCurrentPage(pageRef);. public ExtendedController(ApexPages.StandardController cntrl){}. ApexPages.currentPage().getParameters().put('input'. 'TestValue');. String nextPage = controller.save().getUrl();. A Salesforce administrator used Flow Builder to create a flow named "accountOnboarding". The flow must be used inside an Aura component. Which tag should a developer use to display the flow in the component?. aura-flow. lightning:flow. aura:flow. lightning-flow. What is an example of a polymorphic lookup field in Salesforce?. The WhatId field on the standard Event object. A custom field, Link__c, on the standard Contact object that looks up to an Account or a Campaign. The LeadId and ContactId fields on the standard Campaign Member object. The ParentId field on the standard Account object. While developing an Apex class with custom search functionality that will be launched from a Lightning Web Component, how can the developer ensure only records accesible to the currently logged in user are displayed?. Use the without sharing keyword. Use the with_sharing keyword. Use the inherited sharing keyword. Use the WITH SECURITY_ENFORCED clause withing the SOQL. What are two characteristics related to formulas?. Formulas are calculated at runtime and are not stored in the database. Formulas con reference themselves. Fields that are used in a formula field can be deleted or edited without editing the formula. Formulas con reference values in related objects. A custom object Trainer__c has a lookup field to another custom object Gym__c. Which SOQL query will get the record for the Viridian City Gym and all it's trainers?. SELECT Id, (SELECT Id FROM Trainer__c) FROM Gym__c WHERE Name = 'Viridian City Gym'. SELECT Id, (SELECT Id FROM Trainers__r) FROM Gym__c WHERE Name = 'Viridian City Gym'. SELECT Id, (SELECT Id FROM Trainers__c) FROM Gym__c WHERE Name = 'Viridian City Gym'. SELECT Id FROM Trainer__c WHERE Gym__r.Name = 'Viridian City Gym'. A developer created a Lightning web component called statusComponent to be inserted into the Account record page. Which two things should the developer do to make this component available?. Add <masterLabel> Account</masterLabel> to the statusComponent.js-meta.xml file. Add <target> lightning_RecordPage </target> to the statusComponent.js file. Set isExposed to true in the statusComponent.js-meta.xml file. Add <target> lightning__RecordPage</target> to the statusComponent.js-meta.xml file. Consider the following code snippet: public static List<Lead> obtainAllFields(Set<Id> leadIds){ List<Lead> result = new List<Lead>(); for(Id leadId : leadIds){ result.add([SELECT FIELDS(STANDARD) FROM Lead WHERE Id = :leadId]); } return result; } Given the multi-tenant architecture of the Salesforce platform, what is a best practice a developer should implement and ensure succesful execution of the method?. Avoid using variables as query filters. Avoid returning an empty List of records. Avoid performing queries inside for loops. Avoid executing queries without a limit clause. Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional layer of validation using automation. What would be the best solution for this requirement?. Use a before-save Apex trigger on the Lead object to validate the email address and display an error message if it is invalid. Submit a Rest API Callout with a JSON payload and validate the fields on a third party system. Use an Approval Process to enforce the completion of a valid email address using a outbound message action. A custom Visualforce controller calls the ApexPags.addMessage() method, but no messages are rendering on the page. <apex:pageMessage severity-"info"/>. <apex:facet name="messages"/>. <apex:pageMessages/>. <apex:message for="info"/>. A credit card company needs to implement the functionality for a servic agent to process damaged or stolen credit cards. When the customers call in, the service agent must gather many pieces of information. A developer is tasked to implement this functionality. What should the developer use to satisfy this requirement in the most efficient manner?. Lightning Component. Screen-based flow. Approval process. Apex trigger. A developer needs to prevent the creation of Request__c records when certain conditions exist in the system. A RequestLogic class exists that checks the conditions. What is the correct implementation?. trigger RequesTrigger on Request__c(after insert){ RequestLogic.validateRecords(trigger.new); }. trigger RequestTrigger on Request__c (before insert){ RequestLogic.validateRecords(trigger.new); }. An Apex method, getAccounts, thar 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?. @AuraEnabled(getAccounts,{searchTerm: '$searchTerm'}) accountList;. @AuraEnabled(getAccounts, '$searchTerm') accountList;. @wire(getAccounts,{searchTerm: '$searchTerm'}) accountList;. @wire(getAccounts, '$searchTerm') accountList;. A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank Which automation allows the developer to satisfy this requirement in the most efficient manner?. An error condition formula on a validation rule on Opportunity. An Apex trigger on the Opportunity object. A record trigger flow on the Opportunity object. An approval process on the Opportunity object. The following code snippet is executed by a Lightning web component in an environment with more than 2000 lead records: @AuraEnabled public void static updateLeads(){ for(Lead thisLead : [SELECT origin__c FROM Lead]){ thisLead.LeadSource = thisLead.origin__c; update thisLead; } } Which gobernot limit will likely be exceeded within the Apex transaction?. Total number of records retrieved by SOQL queries. Total number of SOQL queries issued. Total number of records processed as a result of DML statements. 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 writter to the debug log?. 0. 1. 2. 3. Which annotation should a developer use on an Apex method to make it available to be wired to a property in a Lightning web component?. @AuraEnabled. @RemoteAction. @RemoteAction(cacheable=true). @AuraEnabled(cacheable=true). The sales management team at Universal Containers requires that the Lead Source field of the Lead record be populated when a Lead is converted. What should be done to ensure that a user populates the Lead Source field prior to converting a Lead?. Create an after trigger on Lead. Use a formula field. Use Lead Conversion field mapping. Use a Validation rule. Universal Containers has a large number of custom applications that were built using a third-party JavaScript framework and exposed using Visualforce pages. The company wants to update these applications to apply styling htat resembles the look and feel of Lightning Experience. What should the developer do to fulfill the business request in the quickest and most effective manner?. Incorporate the Salesforce Lightning Design System CSS stylesheet into the JavaScript applications. Enable Available for Lightning Experience, Lightning Communities, and the mobiel app on Visualforce pages used by the custom application. Set the attribute enableLightning to true in the definition. Rewrite all Visualforce pages as Lightning components. What are two ways for a developer to execute test in an org?. Metadata API. Bulk API. Developer Console. Tooling API. Given the following Apex statement: Account myAccount = [SELECT Id, Name FROM Account]; What occurs when more than one Account is return by the SOQL query?. An unhandled exception is thrown and the code terminates. The query fails and an error is written to the debug log. The variable, myAccount, is automatically cast to the List data type. The first Account returned is assigned to myAccount. Universal Containers is developing a new Lightning web component for their marketing department. They want to ensure that the component is fine tuned and privdes a seamless user experience. What are some benefits of using the Lightning Component framework?. Easy integration with third-party libraries. Automatic support for accesibility standards. Better performance due to client-side rendering. Compatibility with all web browsers. Which statemet describes the execution order when triggers are associated to the same object and event?. Trigger execution order cannot be guaranteed. Triggers are executed alphabetically by trigger name. Triggers are executed in the order they are created. Triggers are executed in the order they are modified. A developer creates a custom exception as shown below: public class ParityException extends Exception{ } What are two ways the developer can fire the exception in Apex?. new ParityException();. new ParityException('parity does not match');. throw new ParityException('parity does not match');. Throw new parityException();. Given the following Anonymous block: List<Case> casesToUpdate = new List<Case>(); for(Case thisCase : [SELECT Id, Status FROM Case LIMIT 50000]){ thisCase.Status = 'Working'; casesToUpdate.add(thisCase); } try{ Database.update(casesToUpdate, false); }catch(Exception e){ System.debug(e.getMessage()); } What should a developer consider fo an environment that has over 10000 Case records?. The try-catch block will handle any DML exceptions thrown. The try-catch block will handle exceptions thrown by governor limits. The transaction will fail due to exceeding the governor limit. The transaction will succeed and changes will be committed. What are two considerations for deploying from a sandbox to production?. Should deploy during business hours to ensure feedback can be quickly addressed. All triggers must have at least one line of test coverage. Unit tests must have calls to the System.assert method. At least 75% of Apex code must be covered by unit tests. How can a developer check the test coverage of autolaunched Flows before deploying them in a change set?. Use the ApexTestResult class. Use the Code Coverage Setup page. Use SOQL and the Tooling API. Use the Flow Properties page. Which two are phases in the Aura application event propagation framework?. Control. Bubble. Emit. Default. Which two actions may cause triggers to fire?. Cascading delete operations. Changing a user's default division when the transfer division option is checked. Renaming or replacing a picklist entry. Updates to FeedItem. A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Within 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?. Use the scapeSingleQuotes method to sanitize the parameter before its use. Use a regular expression on the parameter to remove special characters. Use variable binding and replace the dynamic query with a static SOQL. Use the @ReadOnly annotation and the with sharing keyword on the class. A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. public interface Sortable{ void sort(); } public interface Drawable{ void draw(); } Which is the correct implementation?. Public class DrawList extends Sortable, extends Drawable{ public void sort() {/*xxx*/} public void draw(){/*xxx*/} }. Public class DrawList implements Sortable, Drawable{ public void sort() {/*xxx*/} public void draw(){/*xxx*/} }. Which statemet should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?. Database.insert(records, false). Database.insert(records, true). insert records. insert (records, false). A developer has identified a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the database. Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governos limits? Choose 2 answers. Use the Database.SavePoint method to enforce database integrity. Use the System.Limit class to monitor the current CPU governor limit consumption. Use partial DML statements to ensure only valid data is committed. Use the @ReadOnly annotation to bypass the number of rows returned by a SOQL. A developer wants to mark each Account in a List<Account> as either Active or Inactive, based on the value in the LastModifiedDate field of each Account being greater than 90 days in the past. Which Apex technique should the developer use?. A switch statement, with a for loop inside. An if-else statement, with a for loop inside. A for loop, with an if or if/else statement inside. a for loop, with a switch statement inside. A software company is using Salesforce to track the companies they sell their software to in the Account object. They also use Salesforce to track bugs in their software with a custom object, Bug__c. As part of a process improvement initiative, they want to be able to report on which companies have reported which bugs. Each company shoudl be able to report multiple bugs and bugs can also be reported by multiple companies. What is needed to allow this reporting?. Junction object between Bug__c and Account. Master-detail field on Bug__c to Account. Roll-up summary field of Bug__c on Account. Lookup field on Bug__c to Account. A developer wants to import 500 Opportunity records into a sadbox. Why should the developer choose to use Data Loader instead of Data Import Wizard?. Data import Wizard can not import all 500 records. Data Loader runs from the developer's browser. Data Import Wizard does not support Opportunities. Data Loader Automatically relates Opportunities to Accounts. What should a developer use to fix a Lightning web component bug in a sandbox?. Execute Anonymous. Developer Console. Force.com IDE. VS Code. A developer is asked to write helper methods that create test data for unit tests 01: public TestUtils{ 02: 03: public static Account createAccount(){ Account act = new Account(); //set some fields on act return act; } } What should be changed in the TestUtils class so that its methods are only usable by unit test methods?. Add @isTest above line 03. Change public to private on line 01. Remove static from line 03. Add @isTest above line 01. A lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?. @AuraEnabled(cacheable=true) public static List<Opportunity> seach(String term){}. @AuraEnabled(cacheable=false) public static List<Opportunity> seach(String term){}. @AuraEnabled(cacheable=false) public List<Opportunity> seach(String term){}. @AuraEnabled(cacheable=true) public List<Opportunity> seach(String term){}. A company decides to implement a new process where every time an Opportunity is created, a follow up Task should be created and assigned to the Opportunity Owner. What is the most efficient way for a developer to implement this?. Task actions. Apex trigger on Task. Auto-launched flow on Task. Record-triggered flow on Opportunity. Which three steps allow a custom Scalable Vector Graphic(SVG) to be included in a Lightning web component? Choose 3 answers. Import the static resource and provide a JavaScript property for it. Reference the import in the HTML template. Reference the property in the HTML template. Import the SVG as a content asset file. Upload the SVG as a static resource. A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allos access to the price book?. Use @isTest(SeeAllData=true) and delete the existing standard price book. Use Test.loadData() and a static resource to load a standard price book. Use @TestVisible to allow the test method to see the standard price book. Use Test.getStandardPricebookId() to get the standard pricebook ID. As part of a new feature development, a developer is asked to build a responsive application capable of responding to touch events, that will be executed on stateful clients. Which two technologies are built on a framework that fully supports the business requirement? Choose 2 answers. Aura Components. Lightning Web Components. Visualforce Pages. Visualforce Components. The values 'High', 'Medium', and 'Low' are identified as common values for multiple picklists across different objects. What is an approach a developer can take to streamline maintenance of the picklists and their values, while also restricting the values to the ones mentioned above?. Create the picklist on each object and slect "Restrict picklist to the values defined in the value set". Create the picklist on each object and use Global Picklist Value Set containing the values. Create the picklist on each object and add a validation rule to ensure data integrity. Create the picklist on each object as a required field and select "Display values alphabetically, not in the order entered". 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 query performance?. VS Code IDE. AppExchange. Developer Console. Setup Menu. |




