Questions tagged [for]

The tag has no usage guidance.

15 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
360 views

Lightning Component for Visualforce issue for Guest User

In answer to this thread - Expose Lightning App via Sites (and embed via Canvas) - Doug has mentioned that there is bug for guest user when using LC4VF. "There is currently an issue (actively being ...
0
votes
0answers
24 views

Create a dynamic query for each item in for loop

Hi I want to create a dynamic query for each item in for loop , but again I don't want to execute that query in the for loop, right now since I am creating a query in for loop, I am no option but ...
0
votes
0answers
26 views

Why I cannot update the Account ID on this for loop?

for (Account acc : newAcc_lst) { System.debug('to15format Test 1-> ' + acc.id); Id to15convertString = acc.id; System.debug('to15format Test 2-> ' + to15convertString); String ...
0
votes
1answer
33 views

pass index of for:index value to js

I want to get the value of each tile href value using a function getHref is there a way wherein I can pass the index value to my js as part of getHref parameter. <template for:each={...
0
votes
0answers
15 views

How can I compare elements from a SOQL in a for loop?

I need to compare contract[0] from the same Account with the contract[1], if they have same values as in the specific fields that I'm using in SOQL I don't need to add it on my map.So if contract[1] ...
0
votes
1answer
563 views

AMPScript For Loop Dynamic Variable

I am trying to get a dynamic variable set inside a script block with AMPScript. Here is what I got: FOR @i = 1 to 5 DO TreatAsContent( Concat( "SET @Test", @i, " = ", 'some value' ) ) NEXT @id ...
0
votes
1answer
77 views

How can I avoid nested for loop in the below code?

Can anyone help on avoiding nested for loop in the below code: List<Account> leadAccountIds=[Select Id, OwnerId, Name FROM Account WHERE Name LIKE :Liktr]; System.debug('leadAccountIds=' + ...
0
votes
1answer
275 views

How to create report for Notes object content?

I have a requirement in which client needs monthly data of all the notes related to every lead . This result in huge data which I am doing manuallly now. I query data from workbench and prepare ...
0
votes
0answers
105 views

Apex heap size too large : Error for fieldset

I have to copy field values from Object Business_Plan_abv__c to Business_Plan_Approval_Process_Data_abv__c where API Names are exactly matching. For that I am using fieldset on Business_Plan_abv__c ...
0
votes
2answers
294 views

Using FOR Loop to pull specific row and all subsequent rows from a lookup

I've been having some difficulty getting my loop to work properly and was hoping someone could take a look. The campaign is a recipient is assigned a tier (in this case 1-8), the audience data ...
0
votes
0answers
36 views

Comparing Object References In Trigger Exceeds CPU Limit

I have a trigger in which I want to cater for the requirement to compare records during a bulk insert or update. I want to make sure of the following: No 2 records in the bulk being inserted/updated ...
0
votes
1answer
32 views

Need design help - weservice Real Time import of data to Salesforce and export as excel

Need to build export to excel functionality on salesforce but the tricky and imoortant part is that data resides in some other cloud system not salesforce. I have nearly 1 Million records in the ...
-2
votes
2answers
27 views

How do I test the FOR loop data for this code?

I have written a test class for a class and its coverage is above 75% but I want to increase it and found that a particular for loop is not being covered(written Between ** below). Please help me with ...
-4
votes
1answer
47 views

how to split list into multiples of 10

for( MetadataService.Metadata metaDataService : createFieldList) { system.debug('metaDataService '+metaDataService ); createFieldArray[i] = metaDataService; i++; system.debug('...
-5
votes
2answers
406 views

code coverage for FOR loop in Test class

Unable to cover the code coverage from if condition inside for loop. public class cwrapper{ apply__c g = new apply__c(); selected = false; public cwrapper(apply__c a, boolean selected){ ...