cancel
Showing results for 
Search instead for 
Did you mean: 

Replication In Second Company

Former Member
0 Kudos

Hello Guys,

I created an Addon in SAP B1 to replicate business partner from Company A to Company B. now my client also ask me to replicate the document series in Company A into Company B.

For eg. If in company A user creates or updates a document series these changes should be reflected or replicated in Company B.

i already go through SDK help file and sample projects but didn't find anything related to document series.

I am using SAP B1 v8.8.2 PL 10 along with its SDK.

Accepted Solutions (0)

Answers (2)

Answers (2)

edy_simon
Active Contributor
0 Kudos

Hi,

If you have got your answer, please close the thread.

Regards,

Edy

edy_simon
Active Contributor
0 Kudos

Hi Faisal,

Below are taken from DI Ref.

How to get a series :

Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oSeriesService As SAPbobsCOM.SeriesService
Dim oSeries As Series
Dim oSeriesParams As SeriesParams

'get company service
oCmpSrv = oCompany.GetCompanyService
'get series service
oSeriesService = oCmpSrv.GetBusinessService(ServiceTypes.SeriesService)
'get series params
oSeriesParams = oSeriesService.GetDataInterface(SeriesServiceDataInterfaces.ssdiSeriesParams)
'set the number of an existing series
oSeriesParams.Series = 84
'get the series
oSeries = oSeriesService.GetSeries(oSeriesParams)
'print the series name
Debug.WriteLine(oSeries.Name)

How to add a series :

Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oSeriesService As SAPbobsCOM.SeriesService
Dim oSeries As Series
Dim oSeriesParams As SeriesParams

'get company service
oCmpSrv = oCompany.GetCompanyService
'get series service
oSeriesService = oCmpSrv.GetBusinessService(ServiceTypes.SeriesService)
'get series
oSeries = oSeriesService.GetDataInterface(SeriesServiceDataInterfaces.ssdiSeries)
'set series name
oSeries.Name = "Series1"
'set doument type(e.g. Deliveries=15)
oSeries.Document = 15
'set the period indicator
oSeries.PeriodIndicator = "Default"
'set the group code
'(enum BoSeriesGroupEnum has all Group Enum)
oSeries.GroupCode = 1
'set the first number
oSeries.InitialNumber = 300
'set last number
oSeries.LastNumber = 350
'add series
'before adding the series to the document check that the lastNumber property
'of the last series has a value(if not the add function will fail)
oSeriesParams = oSeriesService.AddSeries(oSeries)

Regards

Edy