• srikanth bellamkonda
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Actually data loader is loading wrong dates into SFDC Org.
please observe this,

CASE:1 (Correctly Loaded)
Actuall datetime value : = 12/7/11 11:36 PM (MM/DD/YY)
converted datetime value with time zone := 2011-12-07T23:36:44.44Z (yyyy-mm-ddThh:mm:ss.sssZ)
 Result in SFDC: = 7/12/2011 7:36 PM (Correctly loaded DD/MM/YYYY)

where as in 

CASE 2: (Wrongly loaded)
Actuall datetime value : = 4/13/12 9:32 AM (MM/DD/YY)
converted datetime value with time zone := 2012-04-13T09:32:01.01Z (yyyy-mm-ddThh:mm:ss.sssZ)
 Result in SFDC: = 1/4/1913 4:32 AM (Wrongly loaded DD/MM/YYYY)

I found that,
1. The MONTH with single DIGIT are loaded Wrongly. (CASE: 2)
2. The MONTH with double DIGIT are loaded Correctly (CASE: 1).

Timezone is (GMT-04:00) Eastern Daylight Time (America/New_York).
Please provide solution on this.
Thank you

 
Hi, Am writing a test class to cover up code coverage, but the AccoutHistory lines are not coverd in the class, how to handle that.
Just assume that, I have a Class chat_piexyz, in that class i have a method 'PopulateChartData()' , In that method we have a if condition like
public With Sharing class Chat_piexyz {
 public Chat_piexyz (ApexPages.StandardController controller) {

// some data

}
Public void PopulateChartData()
{

  List<AccountHistory> accHistory = [Select oldvalue,newvalue, createddate from AccountHistory where AccountId =: accId AND field = 'M_AUM__c' ORDER BY createdDate ASC];
              
if(!accHistory.IsEmpty()){

// do some thing

}

}

But in Test class i wrote a class like this
@isTest
public class Chart_piedata_Test {
    static testMethod void chatContoller() {

        Account Acc = new Account();
        Acc.Name='Test123';

        acc.M_AUM__c = 4000;
         insert Acc; 
       
        acc.M_AUM__c = 20000;
        update acc; 
        system.debug('Test Account++'+acc);
        acc.M_AUM__c = 1000;
        
        update acc;
        system.debug('Update : '+[select oldvalue, newvalue, createddate from AccountHistory where (AccountId = :acc.id and field = 'M_AUM__c') order by createdDate]);
ApexPages.StandardController sc = new ApexPages.StandardController(acc);
         Chat_piexyz  controller =new chat_piexyz(sc);
 controller.PopulateChartData(); 

 }
}

But it is not covering the If condition(Account history) in the class Chat_piexyz.
I run the Query in Query log in developer console, it shows account history data With Respect To Account id.