• kiran.y
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi,

 

i am new to salesforce.

 

i have doubt on collection list

 

1. I need to retrieve records from an object(Ex: Account)

2. Then I have to add those records  to collection LIST dynamically one by one

 

i have use below code But it's giving error So i don't know how to achive it

 

list<string> s = new list<string>();
for (Account tmp : [SELECT name FROM Account order by name])

{
        s.add(tmp);// to add records to list
    system.debug(tmp);
 
}