A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.
What can a developer to do address the issue?
UC Loans is a small company with a part time Salesforce administrator. UC Loans wants to create a Loan__c record whenever an Opportunity is won.
What is the optimal solution for UC Loans to accomplish this?
Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce.
The flow of data is as follows:
* The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds.
* If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds.
* If a match is not found, the integration will create a Lead and a Task for that newly created Lead.
What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?
An org has a Process Builder process on Opportunity that sets a custom field,CommissionBaseAmount__c, when an Opportunity is edited and the Opportunity's Amount changes.
A developer recently deployed an Opportunity before update trigger that uses the CommissionBaseAmount__c and complex logic to calculate a value for a custom field CommissionAmount_c, when an Opportunity stage changes to Closed/Won.
Users report that when they change the Opportunity to Closed/Won and also change the Amount during the same save, the C:rr.i;5icnA.T.cur.t c is incorrect.
Which two actions should the developer take to correct this problem? Choose 2 answers
trigger AssignOwnerByRegion on Account ( before insert, before update )
{
List<Account> accountList = new List<Account>();
for( Account anAccount : trigger.new )
{
Region__c theRegion = [
SELECT Id, Name, Region Manager__c
FROM Region__c
WHERE Name = :anAccount.Region_Name__c
];
anAccount.OwnerId = theRegion.Region_Manager__c;
accountList.add( anAccount );
}
update accountList;
}
Consider the above trigger intended to assign the Account to the manager of the Account's region.
Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)