FavoriteDebaranjan Ghosh (MM) asked in #Salesforce DeveloperOct 27, 2022, 7:42 AMhow do we assign large queries results to a collection ?In Salesforce and looping through the collection ( ie without SOQL for loops )? Please share code example 6 answersSortSort by DateSort by Most HelpfulSort by DateLoad more comments...Accepted AnswerUsman AliOct 27, 2022, 7:50 AMHi @Debaranjan Ghosh You can directly assign to a list variable List<Account> accounts = [SELECT Id FROM Account];Add a commentWrite an answer...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
Accepted AnswerUsman AliOct 27, 2022, 7:50 AMHi @Debaranjan Ghosh You can directly assign to a list variable List<Account> accounts = [SELECT Id FROM Account];