• Vivek Thiru 6
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Here i am trying to append "Updated"  to all of my accounts but no luck. 


public class INFSimpleBatchExp implements Database.Batchable<sobject> {
  
    public Database.QueryLocator start(database.BatchableContext bc )
    {
        String query = 'select id, name from Account';
        return Database.getQueryLocator(query);
    }
   
    public void execute (Database.BatchableContext bc, List<Account> scope )
    {
      
        for(Account acc : scope)
        { 
          
            acc.name = acc.name + 'updated';
        }
    update scope;
    }
   
   
    public void finish(Database.BatchableContext bc)
    {
       
    }
}
----------------------------------------------------------------------------------------------------------------------

I am using following statemets in Developer console

INFSimpleBatchExp inF = new INFSimpleBatchExp();
Database.executeBatch(inF, 200);

Anyone kindly let me know where it went wrong?

wwwwwwThanks,
Prakki