New answers tagged

0

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');


3

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 ...


0

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 = ...


0

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&...


0

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


5

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 ...


2

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 ...


-1

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 ){ }


1

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 ...


1

You should put ' ', but you don't need to escape them try that one https://{myWorkplaceDomainUsed}--sandbox.cs67.my.salesforce.com/services/data/v42.0/query/?q=select+Id+from+Contact+where+Email='apple+super@gmail.com'. If you want IN you can use it like this https://{myWorkplaceDomainUsed}--sandbox.cs67.my.salesforce.com/services/data/v42.0/query/?q=select+...


Top 50 recent answers are included