📚 SAP Business One SDK Help

DeleteFinancialYear Method
See Also  Example
pIFinancialYearParams
The key of the financial year to be deleted

Description

Deletes an existing financial year.

The financial year is specified by its key (AbsId), which is contained in the FinancialYearParams object passed to the method.

Syntax

Visual Basic
Public Sub DeleteFinancialYear( _
   ByVal pIFinancialYearParams As FinancialYearParams _
) 

Parameters

pIFinancialYearParams
The key of the financial year to be deleted

Remarks

You cannot delete a financial year if it is associated with a record in the OACM (accumulation) or OACK (acknowledge number) tables.

Example

Deleting a financial year (C#)Copy Code
try 

    SAPbobsCOM.FinancialYearParams oDeleteLine; 
    oDeleteLine = (SAPbobsCOM.FinancialYearParams)oFYSrv.GetDataInterface(FinancialYearsServiceDataInterfaces.fysFinancialYearParams); 
    oDeleteLine.AbsEntry = 4; 
    oFYSrv.DeleteFinancialYear(oDeleteLine); 

catch (Exception ex) 

    Interaction.MsgBox(ex.Message, (Microsoft.VisualBasic.MsgBoxStyle)(0), null); 
}

See Also