We want to update the item master data using the Data Interface Application Programming Interface (DI API), But unable to update and the application displays an error message.
Sample DI API code:
Dim oItem AsSAPbobsCOM.Items
oItem = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
oItem.GetByKey("i1")
oItem.IntrastatExtension.IntrastatRelevant = BoYesNoEnum.tYES
oItem.IntrastatExtension.CountryOfOrigin = "DK"
RetVal = oItem.Update()
Answer:
Workaround (for all localizations except Italy):
In the DI API script/DTW template, specify the following properties:
- Intrastat type as Item
- Service supply method as Immediate
- Service payment method as Other
Sample script:
Dim oItem As SAPbobsCOM.Items
oItem = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
oItem.GetByKey("i1")
oItem.IntrastatExtension.IntrastatRelevant = BoYesNoEnum.tYES
oItem.IntrastatExtension.Type = BoDocumentTypes.dDocument_Items
oItem.IntrastatExtension.ServiceSupplyMethod = BoServiceSupplyMethods.ssmImmediate
oItem.IntrastatExtension.ServicePaymentMethod = BoServicePaymentMethods.spmOther
oItem.IntrastatExtension.CountryOfOrigin = "DK"
RetVal = oItem.Update()
Workaround for Italy localization:
In the DI API script/DTW template, specify the following properties:
- Intrastat type as Service or Item
- Service supply method as Immediate or To More Resumptions
- Service payment method as Other or Bank Transfer or Accredited to Bank Account