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 ll 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?
A developer has been asked to create code that will meet the following requirements: Receives input of:
Map<Id, Project__c>, List<Account> Performs a potentially long-running callout to an outside web service Provides a way to confirm that the process executed successfully Which asynchronous feature should be used?
What is the output of the following code snippet? 1 Contact con = new Contact( LastName = 'JOHNSON', LeadSource = 'Web') 2 3 Savepoint sp = Database.setSavepoint(); 4 insert con; 5 Database.rollback(sp); 6 7 con.LeadSource = 'Email' 8 insert con;
A developer wants to write a generic Apex method that will compare the Salesforce Name filed between any two object records, for example to compare the Name field of an Account and an Opportunity; or the name of an Account and a Contact.
How should the developer do this?