• Ally Abdool Latiff Mohabuth
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hello,

Is it possible to do query in apex instead of using the conga query soql statement?
Hell0. I need a SOQL query to retrieve the  record created in last 24 hours.. I  need to the query and I am not using it in apex code. So I'm not able to use System.Now .. and If I use LAST_N_DAYS:1, it is not giming me specific last  24 hour range at any time in the day.
Hello, i have a batch class. I need a test class for my finish method which send email. Here are my codes:
global void finish(Database.BatchableContext BC) {
        system.debug('accountsMap: ' + accountsMap);
        if(accountsMap != null
           && accountsMap.size() > 0){
            
            Messaging.SingleEmailMessage mail = null;   
            List<Messaging.singleEmailMessage> mailsList = new List<Messaging.singleEmailMessage>();
            Id contactId = null;
               
      		for(Order__c ord : accountsMap.values()){
                if(ord.Account__r.Carer__c != null && ord.Account__r.Carer__r.IsCustomerPortal){
                    contactId = (ord.Account__r.Carer__r.PersonContactId != null) ? ord.Account__r.Carer__r.PersonContactId :null;
                }else if(ord.Account__r.IsCustomerPortal != null){
                    contactId = (ord.Account__r.PersonContactId != null) ? ord.Account__r.PersonContactId :null;
                }
                
                if(contactId != null){
                    List<EmailTemplate> template = [SELECT Id FROM EmailTemplate WHERE DeveloperName = 'Stock_Due_Reminder' LIMIT 1];
                    
                    if(template.size() > 0){
                        mail = new Messaging.SingleEmailMessage(); 
                        mail.setTemplateId(template[0].Id);
                        mail.setTargetObjectId(contactId);
                        mailsList.add(mail);
                    }
                }
            }

 
Hello,

I am trying to return a date from a text field and i need to have it in the format of DD/MM/YYYY but i am getting it in the form of D/M/YYYY. 
For example, for 03/05/2010 i am getting 3/5/2010.

this is the formula i used: 
TEXT( Day( DateValue( Date_of_Birth__c) ) ) +'/'+ TEXT( MONTH( DateValue( Date_of_Birth__c) ) ) +'/'+ TEXT( YEAR( DateValue( Date_of_Birth__c) ) ), null )

Thank you!
Hell0. I need a SOQL query to retrieve the  record created in last 24 hours.. I  need to the query and I am not using it in apex code. So I'm not able to use System.Now .. and If I use LAST_N_DAYS:1, it is not giming me specific last  24 hour range at any time in the day.
Hello, i have a batch class. I need a test class for my finish method which send email. Here are my codes:
global void finish(Database.BatchableContext BC) {
        system.debug('accountsMap: ' + accountsMap);
        if(accountsMap != null
           && accountsMap.size() > 0){
            
            Messaging.SingleEmailMessage mail = null;   
            List<Messaging.singleEmailMessage> mailsList = new List<Messaging.singleEmailMessage>();
            Id contactId = null;
               
      		for(Order__c ord : accountsMap.values()){
                if(ord.Account__r.Carer__c != null && ord.Account__r.Carer__r.IsCustomerPortal){
                    contactId = (ord.Account__r.Carer__r.PersonContactId != null) ? ord.Account__r.Carer__r.PersonContactId :null;
                }else if(ord.Account__r.IsCustomerPortal != null){
                    contactId = (ord.Account__r.PersonContactId != null) ? ord.Account__r.PersonContactId :null;
                }
                
                if(contactId != null){
                    List<EmailTemplate> template = [SELECT Id FROM EmailTemplate WHERE DeveloperName = 'Stock_Due_Reminder' LIMIT 1];
                    
                    if(template.size() > 0){
                        mail = new Messaging.SingleEmailMessage(); 
                        mail.setTemplateId(template[0].Id);
                        mail.setTargetObjectId(contactId);
                        mailsList.add(mail);
                    }
                }
            }

 
Hello,

I am trying to return a date from a text field and i need to have it in the format of DD/MM/YYYY but i am getting it in the form of D/M/YYYY. 
For example, for 03/05/2010 i am getting 3/5/2010.

this is the formula i used: 
TEXT( Day( DateValue( Date_of_Birth__c) ) ) +'/'+ TEXT( MONTH( DateValue( Date_of_Birth__c) ) ) +'/'+ TEXT( YEAR( DateValue( Date_of_Birth__c) ) ), null )

Thank you!