📚 SAP Business One SDK Help

DeleteState Method
See Also  Example
pIStateParams
The key of the state to be deleted.

Description

Deletes an existing state.

The state is specified by its key (Code, Country), which is contained in the StateParams object passed to the method.

Syntax

Visual Basic
Public Sub DeleteState( _
   ByVal pIStateParams As StateParams _
) 

Parameters

pIStateParams
The key of the state to be deleted.

Example

Deleting a state (C#)Copy Code
// Get states service 
CompanyService oCompanyService = oCompany.GetCompanyService(); 
StatesService oStatesService = (StatesService)oCompanyService.GetBusinessService(ServiceTypes.StatesService); 
 
// Delete a state 
SAPbobsCOM.StateParams oStateParams = (SAPbobsCOM.StateParams)oStatesService.GetDataInterface 
    (StatesServiceDataInterfaces.ssStateParams); 
 
oStateParams.Code = "ZZ1"; 
oStateParams.Country = "US"; 
 
oStatesService.DeleteState(oStateParams);

See Also