📚 SAP Business One SDK Help

UpdateSection Method
See Also  Example
pISection
The data for the section to be updated. The Section object must contain the key of the object to be updated.

Description

Updates an existing section.

The data for the section, including the key of the section to be updated, is contained in the Section passed to the method. To update a section, you must first retrieve it using the GetSection method.

Syntax

Visual Basic
Public Sub UpdateSection( _
   ByVal pISection As Section _
) 

Parameters

pISection
The data for the section to be updated. The Section object must contain the key of the object to be updated.

Remarks

If the section is associated with a withholding tax code (WithholdingTaxCodes) or certificate series (CertificateSeries), you cannot update the Code and ECode properties.

Example

Updating a section (C#)Copy Code
try 

    SAPbobsCOM.SectionParams oSecPara = (SAPbobsCOM.SectionParams)oSectionSrv.GetDataInterface(SectionsServiceDataInterfaces.ssSectionParams); 
 
    oSecPara.AbsEntry = 10; 
    SAPbobsCOM.Section oSec = oSectionSrv.GetSection(oSecPara); 
    oSec.ECode = "09J"; 
    oSec.Description = "Human"; 
    oSectionSrv.UpdateSection(oSec); 

catch (Exception ex) 

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

See Also