Linked Questions
12 questions linked to/from Performance comparison of Nested for loop to Normal when the number of records it will process are same
-2
votes
1
answer
1k
views
HOW TO Avoid three or more nested LOOPS [duplicate]
for(String objectName : jsonMap.keySet()){
// List<map<String,String>> listObjects=jsonMap.get(objectName);
List<Map <String, String>> ...
1
vote
0
answers
15
views
Avoid iterating over list inside loop [duplicate]
Hello guys I have two lists. One has contact records and other has ContentVersion records. What I need to do is that by every contact I have to create a documents and attach to them by using the ...
4
votes
2
answers
16k
views
ConcurrentPerOrgLongTxn Limit exceeded. Does SOQL query and Apex Callout timings gets counted
Apex CPU Time limit: Here Query timings and Callout timings does not get counted.
But would SOQL timings and Callout timings contribute to ConcurrentPerOrgLongTxn ?
We started hitting ...
4
votes
1
answer
865
views
Is there any better version in which I can write this code?
I am getting the expected output, but I would like to get optimized and cleaned code. I am using for inside for in accounttriggerhandler. Since it is not a good practice, I always avoid it.
I tried ...
4
votes
2
answers
971
views
Efficiently sorting a list of Work Order records by a Sequence
I have Work_Order_Sequence__c and UniqueKey__c field on Work Order object. In my method I wish to create a Map which has a Key => UniqueKey__c and Value=> List<WorkOrder> (sorted). ...
0
votes
1
answer
1k
views
I want to use map instead of 2 for loops
I have a situation where I have a case object which has the Asset Object as its child. I need to check whether a case has an asset with the name 'Test' and then use the created date field of that Test ...
2
votes
1
answer
626
views
DML for SOQL Result +Limits
I am trying to query list of records, make changes and update the same. I see two approaches here:
Approach 1:
List<Account> listOfAccToUpdate=new List<Account>();
for(Account acc: [...
0
votes
1
answer
558
views
Is there any way to replace nested for loop with map for the following apex trigger?
trigger oppTrigger on Opportunity (after insert,after update) {
Set<Id> accIds = new Set<Id>();
Set<Id> oppIds = new Set<Id>();
List<Account> accToAdd = new ...
-2
votes
1
answer
209
views
Hi guys, can you please help me rewrite the nested loop from the end of the codes [closed]
//triggers
rigger MaintenanceRequest on Case (after update) {
MaintenanceRequestHelper.updateWorkOrders(Trigger.New);
}
public with sharing class MaintenanceRequestHelper {
public static void ...
0
votes
1
answer
161
views
Two inner loop need to replace with map.can we? [closed]
I am new to coding.here i want to replace the two for loop using map.can we do it?
ContentVersion versionIn = [
SELECT VersionData, VersionNumber, PathOnClient
FROM ContentVersion
WHERE ...
1
vote
1
answer
178
views
not able to iterate opportunityLineItem from Opportunity in VF page
I have to display all accounts and their opportunity and their associated opportunity line item in vf page. I was able to achieve account and its opportunity but when adding code for opportunity line ...
-4
votes
1
answer
76
views
Can someone help me to convert the Apex class into a Batch Class [closed]
public class CLS_CodetabelleChange1 {
public void splitupdate(List<Account> AccountListe){
List<Account>updateListe=new List<Account>();
List<Account&...