Linked Questions

-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>> ...
ABC's user avatar
  • 1
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 ...
TechGuy's user avatar
  • 127
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 ...
Nagendra Singh's user avatar
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 ...
NBR's user avatar
  • 269
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). ...
SfdcBat's user avatar
  • 4,839
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 ...
Indu Prasad's user avatar
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: [...
Deep Singhal's user avatar
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 ...
SAURABH GOSWAMI's user avatar
-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 ...
Hoang Bui's user avatar
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 ...
Basu's user avatar
  • 23
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 ...
Sumathi Perumal's user avatar
-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&...
user avatar