New answers tagged


This is a "feature" of System.debug of an sobject A way to verify: String[] debugLines = new List<String>(); for (ID recId : mapToMap.keySet() ) { GPMIR_obj_energyLead__c rec = mapToMap.get(recId); debugLines.add(rec + ' ' + rec.Community__r.Name__c + ' ' + ....); } System.debug(String.join(debugLines,'\n');


There is no way to load more than a total of 50K records in a given synchronous session/transaction (as per the documentation), and certainly no way to do this in a trigger. The only way to deal with this sort of thing is to use async processing such as in a Batchable as you mentioned. It is possible to execute certain types of aggregate query across more ...


This is an alternative I tried, worth a shout. //CoBId is set of all CoB List<Customer_OnBoarding__c> CustOB = [SELECT Id, (SELECT Id FROM Attachments) FROM Customer_OnBoarding__c WHERE Id = :CoBId]; if (!CustOB.isEmpty()) { Set<Id> attachmentIds = (new Map<Id, SObject>(CustOB[0])).keySet(); List<Attachment> files = ...


There's no method in the provided List class that will do this. Iterating over a list is not very resource intensive, and will be faster than re-querying. A quick method like this should do the trick: private List<Animal__c> animalListByRT (List<Animal__c> animals, Id recordTypeId) { List<Animal__c> animalList = new List<Animal__c&...


may be List animals = [Select Id, RecordType.Name from Animal__c where RecordTypeId = 'YOUR_ANIMAL_RECORD_TYPE_ID']


My answer is that it doesn't matter for this example as the volume of data you are dealing with - 340 records - is small so optimization is way down the priorities. My priority list is ballpark this if there is nothing extreme about the code: Code that works Tests that prove the code works Code that doesn't run into query or CPU or heap governor limits Code ...


I don't think that using an aggregate query on Agent is the right approach here. Aggregate functions and the GROUP BY keyword are meant to aggregate data about a group of records (what is the maximum value of field X for this group of records?) rather than pull out a single record from a group. What you're looking for here, assuming that CaseId is a lookup ...


You are trying to write Aggregate query which cannot be assigned to list AggregateResult[] lstAggregareResult = [SELECT WorkItemId, Id, CaseId, MAX(CreatedDate) FROM Agent GROUP BY WorkItemId]; and then you can iterate over aggregate list for further computation as: for(AggregateResult objAggre: lstAggregareResult ){ }


I don't think you need a batch class for this. At the data volume you mentioned I expect somewhere between 100-200 records for Country. and maybe 500-1000 records for City you should be able to handle this with a couple of quick queries and run updates: Map<Id, Continent__c> continentsToUpdate = new Map<Id, Continent__c>(); // First, find ...


You should put ' ', but you don't need to escape them try that one https://{myWorkplaceDomainUsed}''. If you want IN you can use it like this https://{myWorkplaceDomainUsed}

Top 50 recent answers are included