• siddartha reddy kalam
  • NEWBIE
  • 30 Points
  • Member since 2019

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I am trying to calculate the number of days between two date fields but my formula is not working and I can't figure out why. I have a field called Completion_Photos_Upload_Date__c and another called Completion_report_due__c. and a formula field called Completion_Photo_Timing which should calculate the number of days between the dates. Example: one record has a Completion Photos Upload Date of 5/28/2019 and a Finished School Photos Due date of 5/12/2019 which is 16 days. Right now with this formula: DATEVALUE(Completion_Photos_Upload_Date__c )- Completion_report_due__c only shows 9 days. Not sure what's wrong with this formula. There are no syntax errors but 9 days is not the correct answer. Any help fixing would be appreciated. 
Hello everyone, I need help in writitng a test class for below code.

public with Sharing class DAP_ConcurQueueAccounts 
{
 public class Output{
        
        @InvocableVariable(required= true)
     public Integer statusCode;}
    
  public class Input{
        @InvocableVariable(required= false)
        public string account;
        
        @InvocableVariable(required= false)
        public decimal lastmod;
        
        @InvocableVariable(required= false)
        public string resource;
        
        @InvocableVariable(required= false)
        public integer maxItems;
    }
   @InvocableMethod
    public static List<Output> queueAccounts(List<Input> input )
    {
         List<Output> statuscodeoutput = new List<Output>();
        for(Input queaccinput : input)
        {
             // JK Renamed output variable
             Output out = new Output();
             
             System.debug('account: ' + queaccinput.account);
             System.debug('lastmod: ' + queaccinput.lastmod);
             System.debug('resource: ' + queaccinput.resource);
             System.debug('maxItems: ' + queaccinput.maxitems);
            
            Long startTimeLong = DateTime.now().getTime();
             System.debug('Start time: ' + startTimeLong);
             
             String bodyString = 'account='+queaccinput.account+'&lastmod='+queaccinput.lastmod;
             System.debug('Account & lastmod params: ' + bodyString);
            
         
             HttpRequest req = new HttpRequest();
             req.setEndpoint('callout:xyz.com');
             req.setMethod('POST');
             req.setTimeout(9000);
             
req.setBody(bodyString);
            
             Http http = new Http();
             HTTPResponse res = http.send(req);
            
             out.statusCode = res.getStatusCode();
             statuscodeoutput.add(out);
            
             
             System.debug('Response status code: ' + res.getStatusCode());
            
      
        }
     return  statuscodeoutput; 
    }
}
Hello, Can anyone help me in creating invocable apex class with following requirments.
input: account, Last modified by
output: statuscode
invocable method should take inputs and convert them as body of http request"xyz.com/api/accounts." and statuscode should be returned as output
Hello everyone, I need help in writitng a test class for below code.

public with Sharing class DAP_ConcurQueueAccounts 
{
 public class Output{
        
        @InvocableVariable(required= true)
     public Integer statusCode;}
    
  public class Input{
        @InvocableVariable(required= false)
        public string account;
        
        @InvocableVariable(required= false)
        public decimal lastmod;
        
        @InvocableVariable(required= false)
        public string resource;
        
        @InvocableVariable(required= false)
        public integer maxItems;
    }
   @InvocableMethod
    public static List<Output> queueAccounts(List<Input> input )
    {
         List<Output> statuscodeoutput = new List<Output>();
        for(Input queaccinput : input)
        {
             // JK Renamed output variable
             Output out = new Output();
             
             System.debug('account: ' + queaccinput.account);
             System.debug('lastmod: ' + queaccinput.lastmod);
             System.debug('resource: ' + queaccinput.resource);
             System.debug('maxItems: ' + queaccinput.maxitems);
            
            Long startTimeLong = DateTime.now().getTime();
             System.debug('Start time: ' + startTimeLong);
             
             String bodyString = 'account='+queaccinput.account+'&lastmod='+queaccinput.lastmod;
             System.debug('Account & lastmod params: ' + bodyString);
            
         
             HttpRequest req = new HttpRequest();
             req.setEndpoint('callout:xyz.com');
             req.setMethod('POST');
             req.setTimeout(9000);
             
req.setBody(bodyString);
            
             Http http = new Http();
             HTTPResponse res = http.send(req);
            
             out.statusCode = res.getStatusCode();
             statuscodeoutput.add(out);
            
             
             System.debug('Response status code: ' + res.getStatusCode());
            
      
        }
     return  statuscodeoutput; 
    }
}
I am trying to calculate the number of days between two date fields but my formula is not working and I can't figure out why. I have a field called Completion_Photos_Upload_Date__c and another called Completion_report_due__c. and a formula field called Completion_Photo_Timing which should calculate the number of days between the dates. Example: one record has a Completion Photos Upload Date of 5/28/2019 and a Finished School Photos Due date of 5/12/2019 which is 16 days. Right now with this formula: DATEVALUE(Completion_Photos_Upload_Date__c )- Completion_report_due__c only shows 9 days. Not sure what's wrong with this formula. There are no syntax errors but 9 days is not the correct answer. Any help fixing would be appreciated.