MyOpportunities.js
JavaScript
import { LightningElement, api, wire } from 'lwc';
import getOpportunities from '@salesforce/apex/OpportunityController.findMyOpportunities';
export default class MyOpportunities extends LightningElement {
@api userId;
@wire(getOpportunities, {oppOwner: '$userId'})
opportunities;
}
OpportunityController.cls
Java
public with sharing class OpportunityController {
@AuraEnabled
public static List
return [
SELECT Id, Name, StageName, Amount
FROM Opportunity
WHERE OwnerId = :oppOwner
];
}
}
A developer is experiencing issues with a Lightning web component. The co12mponent must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: "Error retrieving data". Which action must be completed in the Apex method to make it wireable?13
Refer to the Aura component below:
HTML
<aura:component>
<aura:attribute name="contactInfo" type="Object"/>
<aura:attribute name="showContactInfo" type="boolean" default="true"/>
<aura:handler name="init" value="{!this}" action="{!c.init}"/>
<aura:if isTrue="{!v.showContactInfo}">
</aura:if>
</aura:component>
A developer receives complaints that the component loads slowly. Which change can the developer implement to make the component perform faster?
A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org. An Apex method prepares and returns data to the component. What should the developer do to determine which objects to include in the response?
Java
@isTest
static void testUpdateSuccess() {
Account acet = new Account(Name = 'test');
insert acet;
// Add code here
extension.inputValue = 'test';
PageReference pageRef = extension.update();
System.assertNotEquals(null, pageRef);
}
What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?
The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state. Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has one Campaign Member. This means there are 10,000 Contact records across th23e Accounts and 10,000 Campaign Member records across the contacts. What will happen when the mass update occurs?24252627
A developer is asked to look into an issue where a scheduled Apex is running into DML limits. Upon investigation, the developer finds that the number of records processed by the scheduled Apex has recently increased to more than 10,000. What should the developer do to eliminate the limit exception error?
A developer created the following test method:
Java
@isTest(SeeAllData= true)
public static void testDeleteTrigger(){
Account testAccount = new Account(name = 'Test1');
insert testAccount;
List
System.assert(testAccounts.size() > 0);
delete testAccounts;
testAccounts = [SELECT Id, Name from Account WHERE Name like 'Test%'];
System.assert(testAccounts.size() == 0);
}
The developer org has five accounts where the name starts with "Test". The developer executes this test in the Developer Console.
After the test code runs, which statement is true?
A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called Survey_Response__c do not belong to a list of blocked domains. The list of blocked domains is stored in a custom object for ease of maintenance by users. The Survey_Response__c object is populated via a custom Visualforce page. What is the optimal way to implement this?
Universal Containers has an Apex trigger on Account that creates an Account Plan record when an Account is marked as a Customer. Recently a record-triggered flow was added to update a date field. Since the addition of the flow, two Account Plan records are created. What might cause this to happen?
Refer to the component code and requirements below:
HTML
Requirements:
For mobile devices, the information should display in three rows.
For desktops and tablets, the information should display in a single row.
Requirement 2 is not displaying as desired. Which option has the correct component code to meet the requirements for desktops an7d tablets?