📚 SAP Business One SDK Help

GetBranch Method
See Also  Example
pIBranchParams

The key of the branch to retrieve.

Description

Retrieves a specific branch.

The branch is specified by its key (Code), which is contained in the BranchParams object passed to the method.

Syntax

Visual Basic
Public Function GetBranch( _
   ByVal pIBranchParams As BranchParams _
) As Branch

Parameters

pIBranchParams

The key of the branch to retrieve.

Return Type

The branch with the specified key.

Example

Getting a branch (C#)Copy Code
public void update() 

    try 
    { 
        BranchParams getLine; 
        SAPbobsCOM.Branch updateLine; 
        getLine = (BranchParams)oBranchSrv.GetDataInterface(BranchesServiceDataInterfaces.bsBranchParams); 
 
        //update a record 
        //please note that the code should be of an existing record. 
        getLine.Code = 5; 
 
        updateLine = oBranchSrv.GetBranch(getLine); 
        updateLine.Name = "T"; 
        updateLine.Description = "Y branch"; 
        oBranchSrv.UpdateBranch(updateLine); 
    } 
    catch (Exception ex) 
    { 
        Interaction.MsgBox(ex.Message, (Microsoft.VisualBasic.MsgBoxStyle)(0), null); 
    } 

See Also