A developer writes the following Apex trigger so that when a Case is closed, a single Survey record is created for that Case. The issue is that multiple Survey_c records are being created per Case.
trigger CaseTrigger on Case (after insert, after update){ List<Survey_c> createSurveys = new List<Survey_c>(); for (Case c : trigger.new){ if (c.IsClosed
&& (trigger.isInsert II trigger.isUpdate && trigger.oldMap.get(c.Id).IsClosed == false)){ createSurveys.add(new Survey_c(Case_c = c.Id)); } } insert createSurveys; } What could be the cause of this issue?
Exhibit:
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 2 answers
An org contains two custom objects; Building__c and Office__c. Office__c has a Lookup field to Building__c.
A developer is asked to automatically populate the Number_of_Offices__c field on the Building__c object with the count of related Office__c
records anytime an Office__c record s created or deleted. The developer cannot modify the field types.
Which solution meets the requirements?
Lightning Aura Component
Lightning Aura Controller
Apex Controller
Given the code above, which two changes need to be made in the Apex Controller for the code to work?
(Choose two.)
A developer is writing code that requires making callouts to an external web service. Which scenario necessitates that the callout be made in an @future method?