function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
magalie pickertmagalie pickert 

for loop problem

Hi,

I try to do a bulkifly trigger...
And I'm becoming a non understandable failure. I hope you can help me....

Code:
 Error: Kompilierungsfehler: Loop condition must be of type Boolean: Integer in Zeile 12 Spalte 19

 
My Code is:

Code:
trigger InitialContactSolution on Obj__c (after insert) {


// create list
Obj__c[] ObjToUpdate = new Obj__c[0];

// perform looping action
for (Obj__c cl : Trigger.new) {
     ObjToUpdate.add(cl); 
}
if (!ObjToUpdate.isEmpty()) {
for (Integer i=0; ObjToUpdate.size(); i++){
   newGatheringController.InsertTask(ObjToUpdate[i]);
   }
}
}

 Thx


ShamSham
ObjToUpdate.size()
Problem lies in this line.

use i < ObjToUpdate.size();
magalie pickertmagalie pickert
Thx for your answer...


I know that i become only one row that's why i use this request:
Code:
[SELECT Name, OwnerId, AccountId FROM Contact WHERE ID = :info limit 1]


 Now i don't need a for loop.
But I will remember that for the next devloppment...

Thx