A developer wants to create a Visualforce page that allows a user to search for a given account by Name. If the account is found, the account details should be populated on screen. If no account is found, an error message should be displayed to the user.How can this be accomplished? (Choose two.)
A developer has built a multi-page wizard using a single Custom Controller to query and update data. Users are complaining that the pages are loading slowly.What will improve performance? (Choose three.)
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?
What is a potential design issue with the following code?trigger accountTrigger on Account (before update){ Boolean processOpportunity = false; List<opportunity> opptysClosedLost = new List<opportunity>() List<opportunity> IstAllOpp = [select StageName from Opportunity where accountId IN :Trigger.newMap.keySet()]; if(!IstAllOpp.isEmpty()) processOpportunity = true; while(processOpportunity){ for(opportunity o : IstAllOpp) if(o.StageName == 'Closed - Lost') opptysClosedLost.add(o); processOpportunity = false; if(!opptysClosedLost.isEmpty()) delete opptysClosedLost;
The Contact object has a custom field called "Zone." Its data type is "Text" and field length is 3.What is the outcome after executing the following code snippet in the org?List<Contact> contactsToBeInserted=new List<Contact>(); Contact contactInstance= new Contact(LastName='Smith',Department='Tech', Zone_c='IAD'); contactsToBeInserted.add(contactInstance); contactInstance= new Contact(LastName='Sm1th', Department='Tech', Zone_c='PITT'); contactsToBeInserted.add(contactInstance); Database.insert(contactsToBeInserted,true);
A Visualforce page loads slowly due to the large amount of data it displays.Which strategy can a developer use to improve the performance?