📚 SAP Business One SDK Help

UpdateFinancePeriod Method
See Also  Example
pIFinancePeriod
FinancePeriod data input.

Description

Updates the FinancePeriod data.

Syntax

Visual Basic
Public Sub UpdateFinancePeriod( _
   ByVal pIFinancePeriod As FinancePeriod _
) 

Parameters

pIFinancePeriod
FinancePeriod data input.

Example

Shows how to update a Finance Period
UpdateFinancePeriod (Visual Basic)Copy Code
Dim oCompanyService As SAPbobsCOM.CompanyService
Dim oPeriodCategoryColl As PeriodCategoryParamsCollection
Dim oPerCategory As PeriodCategoryParams
Dim oFinancePeriods As FinancePeriods
Dim oFinancePeriod As FinancePeriod

'get company service
oCompanyService = oCompany.GetCompanyService

'get period category Collection
oPeriodCategoryColl = oCompanyService.GetPeriods

'get period category params
oPerCategory = oPeriodCategoryColl.Item(1)

'get all finance periods (if the sub period isn't a year then it
'has more than one finance period for example sub period month has 12 finance
'periods)
oFinancePeriods = oCompanyService.GetFinancePeriods(oPerCategory)

'get the first finance period
oFinancePeriod = oFinancePeriods.Item(0)

'update the period name
oFinancePeriod.PeriodName = "MyFinancePeriod"

'update finance period
oCompanyService.UpdateFinancePeriod(oFinancePeriod)

See Also