Skip to main content

Posts

Showing posts from October, 2014

Loading Test Data ... made my life easier

Hallooo... I am still here, I forgot that I have a technical blog =) Okay, I would like to share that something that maybe there for very long time, but I just utilized it recently. My organization have something that we call Financial Calendar, it is different from our normal life calendar, where by if in our normal life a new year start on every 1 January, our financial start in different month. Well, it is not big deal except in Salesforce we need to do test class, and most of our classes having logic such the object linked to calendar object, if new quarter come in populate the data etc. Last time we just use @SeeAllData=true in order to access into this object from test class,but as you and I know it is not advisable as it may lead to other issue. So we do something like this in our test class.We need to populate record for Financial Calendar in order to use it. FinancialCalendar__c c1 = new FiscalCalendar__c(); . . . The code goes down , to define the quarter.