• ShekarMS
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
I have tried this  below  code its not working 
someone please help me writing the batch class and test class for this scenerio

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

    //Excute method
    
global void execute(Database.BatchableContext BC, List<Opportunity> scope)
{
    //Excution logic
    //List<Opportunity> opp= new List<Opportunities>();
    AggregateResult[] gr= [SELECT SUM(Amount) optyamt FROM Opportunity];
    
    for(AggregateResult ag:gr){
        sum = (Decimal)ag.get('optyamt');
    }
    
}
      global void finish(Database.BatchableContext BC){
            // Finish logic
          system.debug(''+sum); 
       }
}
Hi All,

I am designed visualforce page with slds. When i am resizing the browser, fields are overlapping. Can any one help me on this

Thanks,
Naidu
hi
I have a Email Template. I have edited the HTML version of templet and addedd a SELECT Query. This Query will fetch Data from a Custom Object. Custome Object has a Lookup Field on Contact.
When io run the Email Teplate, the SELECT code is diplay as it is. it is not Run.

Do i Need to writ the SELECT Quiery in some brackets? Can someone tell me the syntax for writing SELECT Query in HTML Email Template.

Dear Investors {!Contact.Name} .
<br>

{
Contact cnt =[Select ID From pba__Property__c where Title = 'Test Sale'];
if (cnt.size() > 0 && cnt.get(0).Body != null)
             {             
                 body = cnt.get(0).Body;
                 body = body.replace('#FieldAPIName#', recordValue);
                }
email.setPlainTextBody(body);
}