📚 SAP Business One SDK Help

CreatePeriod Method
See Also  Example
pIPeriodCategory
PeriodCategory data structure input.

Description

Returns the PeriodCategoryParams Identification Key (PeriodCategory Key) based on the PeriodCategory data structure.

Syntax

Visual Basic
Public Function CreatePeriod( _
   ByVal pIPeriodCategory As PeriodCategory _
) As PeriodCategoryParams

Parameters

pIPeriodCategory
PeriodCategory data structure input.

Example

The following is a VB.NET sample that creates new period categories and returns its parameters.
CreatePeriod (Visual Basic)Copy Code
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)

See Also