• Sindhuja Sundarasudhan
  • NEWBIE
  • 20 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies
Challenge Not yet complete... here's what's wrong:
The field 'Invoice Batch' could not be found on the object Order. Please ensure the field was created according to the requirements and try again.
Can anyone tell me what is my error in this code to delete accounts details in salesforce. I am getting DMLexception error when I execute. 

global class deleteaccount implements Database.Batchable<sobject> {
    global final string Query;
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        string query = 'select Id, name from Account';
        return Database.getQueryLocator(query);
    }
    
    global void execute(Database.BatchableContext BC, list<Account> scope)
   {
    List<Account> lstAccount = new list<Account>();
    for(Sobject s : scope){
     Account a = (Account)s;
    lstAccount.add(a);
    }
    Delete lstAccount;
   } 
        
    global void finish(Database.BatchableContext BC)
    {
        Messaging.singleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'sudhansindhuja@gmail.com'};
            mail.setToAddresses(toAddresses);
        mail.setSubject('job done');
        mail.setPlainTextBody('batch class over');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});
    }
}
Challenge Not yet complete... here's what's wrong:
We can't find the Flow 'Create Order' with the record update step configured according to the requirements.User-added image Can anyone let me kow the error I made. 

I don't want the step to be done. but little guidance. 

Thank you.
Can anyone tell me what is my error in this code to delete accounts details in salesforce. I am getting DMLexception error when I execute. 

global class deleteaccount implements Database.Batchable<sobject> {
    global final string Query;
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        string query = 'select Id, name from Account';
        return Database.getQueryLocator(query);
    }
    
    global void execute(Database.BatchableContext BC, list<Account> scope)
   {
    List<Account> lstAccount = new list<Account>();
    for(Sobject s : scope){
     Account a = (Account)s;
    lstAccount.add(a);
    }
    Delete lstAccount;
   } 
        
    global void finish(Database.BatchableContext BC)
    {
        Messaging.singleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'sudhansindhuja@gmail.com'};
            mail.setToAddresses(toAddresses);
        mail.setSubject('job done');
        mail.setPlainTextBody('batch class over');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});
    }
}