• Ram chowdary
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies

Hi Folks, I have a use case that I need to display total  amount sum from opportunities object in finsh method... please help me ...

global class batchclass1 implements Database.Batchable<Opportunities>{
    
    global batchclass1(){}
        /* Batch class constructor */
    //Start method
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        String query='SELECT id, Amount from Opportunities';
         return Database.getQueryLocator(query);
        }

    //Excute method
    
global void execute(Database.BatchableContext BC, List<Opportunities> scope)
{
    //Excution logic
    List<Opportunities> opp= new List<Opportunities>
    AggregateResult[] gr= [SELECT SUM(Amount) FROM Opportunities];

    
}
      global void finish(Database.BatchableContext BC){
            // Finish logic
           system.debug('gr');
       }
    
    

}

Hi Folks, I have a use case that I need to display total  amount sum from opportunities object in finsh method... please help me ...
Good Evening,

I have created a batch process and inside the execute function, there is a condition. If a condition is meet, I want to stop the batch process and then call another batch process.

What i did at the moment is that I put System.abortJob() function. And call the batch process in my finish function. But when the condition is meet, the abortJob() will also stop the finish function being called therefore i won't call the other batch. I also try to call my other batch before the abortJob() but I will get an error that I cannot call a batch process inside the execute function. What is the other way to fix my problem ? please help.

Thank you...
How can we display 70,000 records in vf page?

I hope its not possible becuase the limit for vf page is 10,000 records, Is there any other work around for it, If so please help me
In an  Account object there are two fields called Address1 and Address2 and I have 100,000 records, out of 70,000 record values are equal in field1 and field2. Now Display those 70,000 records on visualforce page.

How to achieve this?

Hi Folks, I have a use case that I need to display total  amount sum from opportunities object in finsh method... please help me ...

global class batchclass1 implements Database.Batchable<Opportunities>{
    
    global batchclass1(){}
        /* Batch class constructor */
    //Start method
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        String query='SELECT id, Amount from Opportunities';
         return Database.getQueryLocator(query);
        }

    //Excute method
    
global void execute(Database.BatchableContext BC, List<Opportunities> scope)
{
    //Excution logic
    List<Opportunities> opp= new List<Opportunities>
    AggregateResult[] gr= [SELECT SUM(Amount) FROM Opportunities];

    
}
      global void finish(Database.BatchableContext BC){
            // Finish logic
           system.debug('gr');
       }
    
    

}
In an  Account object there are two fields called Address1 and Address2 and I have 100,000 records, out of 70,000 record values are equal in field1 and field2. Now Display those 70,000 records on visualforce page.

How to achieve this?