📚 SAP Business One SDK Help

AddState Method
See Also  Example
pIState
The data for the new state.

Description

Adds a state.

Syntax

Visual Basic
Public Function AddState( _
   ByVal pIState As State _
) As StateParams

Parameters

pIState
The data for the new state.

Return Type

Contains the key (Code, Country) of the new state.

Example

Adding a state (C#)Copy Code
// Get states service 
CompanyService oCompanyService = oCompany.GetCompanyService(); 
StatesService oStatesService = (StatesService)oCompanyService.GetBusinessService(ServiceTypes.StatesService); 
 
// Add a State 
SAPbobsCOM.State oState = (SAPbobsCOM.State)oStatesService.GetDataInterface 
    (StatesServiceDataInterfaces.ssState); 
 
oState.Code = "Z1"; 
oState.Country = "US";  
oState.Name = "ZZ4"; 
                 
oStatesService.AddState(oState);

See Also