최신Salesforce Platform Developer II - PDII무료샘플문제
A developer creates a lightning web component to allow a Contact to be quickly entered. However, error messages are not displayed.
HTML
<template>
<lightning-record-edit-form object-api-name="Contact">
<lightning-input-field field-name="FirstName"></lightning-input-field>
<lightning-input-field field-name="LastName"></lightning-input-field>
<lightning-input-field field-name="Email"></lightning-input-field>
<lightning-button type="submit" name="submit" label="Create Contact">
</lightning-button>
</lightning-record-edit-form>
</template>
Which component should the developer add to the form to display error messages?12
A developer wrote an Apex class to make several callouts to an external system. If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class?
The test method calls an @future method that increments a value. The assertion is failing because the value equals 0. What is the optimal way to fix this?
Java
@isTest
static void testIncrement() {
Account acct = new Account(Name = 'Test', Number_Of_Times_Viewed__c = 0); insert acct; AuditUtil.incrementViewed(acct.Id); // This is the @future method Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0]; System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c);
}
A developer needs to add code to a Lightning web component's configuration file so the component only renders for a desktop size form factor when on a record page. What should the developer add to the component's record page target configuration to meet this requirement?
A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after certain conditions are met. What is the optimal way to accomplish this?
How should a developer verify that a specific Account record is being tested in a test class for a Visualforce controller?
A developer is writing a Lightning Web component that queries accounts in the system and presents a lightning-datatable with the results. The users want to be able to filter the results based on up to five fields, that will vary according to their selections when running the page. Which feature of Apex code is required to facilitate this solution?
A developer is building a Lightning web component that retrieves data from Salesforce and assigns it to the record property:
JavaScript
import { LightningElement, api, wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
export default class Record extends LightningElement {
@api fields;
@api recordId;
record;
}
What must be done in the component to get the data from Salesforce?
Universal Containers wants to use a Customer Community with Customer Community Plus licenses. UC uses a Private sharing model for External users. One of the requirements is to allow certain community users within the same Account hierarchy to see several departments' containers, based on a custom junction object that relates the Contact to the various Account records. Which solution solves these requirements?
The test method tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated. The test method fails at Line 20 because of "too many SOQL queries." What is the correct way to fix this?
Java
Line 12: //Set accounts to be customers
Line 13: for(Account a : DataFactory.accounts)
Line 14: {
Line 15: a.Is_Customer__c = true;
Line 16: }
Line 17:
Line 18: update DataFactory.accounts;
Line 19:
Line 20: List<Account> acctsAfter = [SELECT Number_Of_Transfers__c FROM Account WHERE Id IN :
DataFactory.accounts];
A developer wrote a class named AccountHistoryManager that relies on field history tracking. The class has a static method called getAccountHistory that takes in an Account as a parameter and returns a list of associated AccountHistory object records. The following test fails:
Java
@isTest
public static void testAccountHistory(){
Account a = new Account(name = 'test');
insert a;
a.name = a.name + '1';
update a;
List<AccountHistory> ahList = AccountHistoryManager.getAccountHistory(a); System.assert(ahList.size() > 0);
}
What should be done to make this test pass?
After a platform event is defined in a Salesforce org, events can be published via which mechanism?
A developer has business logic in a trigger that flags high-value opportunities. There is a new requirement to also display high value opportunities in a Lightning web component. Which two steps should the developer take to meet these business requirements, and also prevent the business logic that identifies high-value opportunities from being repeated in more than one place?