The following is a VB.NET sample that creates new period categories and returns its parameters.
Dim oPeriodCategory As PeriodCategory
‘get period category
oPeriodCategory = oCompanyService.GetDataInterface(CompanyServiceDataInterfaces.csdiPeriodCategory)
‘set period code
oPeriodCategory.PeriodCategory = “My Period Code”
‘set period name
oPeriodCategory.PeriodName = “My Period Name”
‘set the period type can be year,quater,month or day
‘(e.g. spt_Year=0,spt_quater=1,spt_month=2,spt_days)
oPeriodCategory.SubPeriodType = BoSubPeriodTypeEnum.spt_Year
‘set the beginning of Financial Year
oPeriodCategory.BeginningofFinancialYear =”2008-01-01″
oCompanyService.CreatePeriod(oPeriodCategory)