A Salesforce Platform Developer is leading a team that is tasked with deploying a new application to production. The team has used source-driven development, and they want to ensure that the application is deployed successfully. What tool or mechanism should be used to verify that the deployment is successful?
A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high value. Current criteria for an opportunity to be considered high value is an amount greater than or equal to $1,000,000. However, this criteria value can change over time. There is a new requirement to also display high value opportunities in a Lightning web component. Which two actions should the developer take to meet these business requirements, and also prevent the business logic that obtains the high value opportunities from being repeated in more than one place?2021
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);
}
An Apex trigger and Apex class increment a counter, `Edit_Count__c`, any time the Case is changed.
```java
public class CaseTriggerHandler {
public static void handle(List
for (Case c : cases) {
c.Edit_Count__c = c.Edit_Count__c + 1;
}
}
}
trigger on Case(before update) {
CaseTriggerHandler.handle(Trigger.new);
}
```
A new before-save record-triggered flow on the Case object was just created in production for when a Case is created or updated. Since the process was added, there are reports that `Edit_Count__c` is being incremented more than once for Case edits. Which Apex code fixes this problem?
Refer to the code snippet below:
Java
public static void updateCreditMemo(String customerId, Decimal newAmount){
List
for(Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50]) {
creditMemo.Amount__c = newAmount;
toUpdate.add(creditMemo);
}
Database.update(toUpdate,false);
}
A custom object called Credit_Memo__c exists in a Salesforce environment. As part of a new feature development, the developer needs to ensure race conditions are prevented when a set of records are mod1ified within an Apex transaction. In the preceding Apex code, how can the developer alter the que2ry statement to use SOQL features to prevent race conditions within a tr3ansaction?4
Part of a custom Lightning component displays the total number of Opportunities in the org, which are in the millions. The Lightning component uses an Apex method to get the data it needs. What is the optimal way for a developer to get the total number of Opportunities for the Lightning component?
A developer is inserting, updating, and deleting multiple lists of records in a single transaction and wants to ensure that any error prevents all execution. How should the developer implement error exception handling in their code to handle this?1234567
Consider the following code snippet:
HTML
<apex:page docType="html-5.0" controller="FindOpportunities">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="find opportunity">
<apex:input label="opportunity name"/>
<apex:commandButton value="search" action="{!search}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Opportunity List" id="opportunityList">
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Users of this Visualforce page complain that the page does a full refresh every time the Search button is pressed. What should the developer do to ensure that a partial refresh is made so that only t13he section identified with opportunityList is re-drawn on the screen?1415
As part of point-to-point integration, a developer must call an external web service which, due to high demand, takes a long time to provide a response. As part of the request, the developer must collect key inputs from the end user before making the callout. Which two elements should the developer use to implement these business requirements?4647
A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:
HTML
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes">
</aura:component>
How can the component's controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?