ExportDeterminationService in SAP Business One DI API enables you to add, update, get and delete Export Determination data in Electronic Documents Export Setup window.
The window Electronic Documents Export Setup is available in SAP Business One when Document Mapping Determination is selected on the Electronic Documents tab of Document Settings (Administration → System Initialization → Document Settings).
The contents of Electronic Documents Export Setup may vary depending on the localization and the chosen electronic document protocol.
Below are some samples which you might find handy when using ExportDeterminationService in SAP Business One DI API:
- Add a new Export Determination:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ExportDeterminationService oExportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ExportDeterminationService);
ExportDetermination oExportDetermination = (ExportDetermination)oExportDeterminationService.GetDataInterface(ExportDeterminationServiceDataInterfaces.edsExportDetermination);
oExportDetermination.Code = ElectronicDocProtocolCodeStrEnum.edpcs_PEPPOL;
oExportDetermination.Priority = 1;
oExportDetermination.BusinessPartner = "TESTBP";
oExportDetermination.Country = "IT";
oExportDetermination.Series = 70;
oExportDetermination.DocumentType = ((int)BoObjectTypes.oCreditNotes).ToString();
oExportDetermination.ExportFormat = -14; //// eDoc PEPPOL - Credit Note (System)
oExportDetermination.PathFileName = @"{OADM.CompnyName}{Entry.ProtocolCode}{OCRD.CardCode}{Entry.SrcObjAbbrev}{ReportID.ReportID}.xml";
oExportDeterminationService.AddDetermination(oExportDetermination);
- Update an existing Export Determination:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ExportDeterminationService oExportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ExportDeterminationService);
ExportDeterminationParams oExportDeterminationParams = oExportDeterminationService.GetDataInterface(ExportDeterminationServiceDataInterfaces.edsExportDeterminationParams);
oExportDeterminationParams.Code = ElectronicDocProtocolCodeStrEnum.edpcs_PEPPOL;
oExportDeterminationParams.AbsEntry = 3;
ExportDetermination oExportDetermination = oExportDeterminationService.GetDetermination(oExportDeterminationParams);
oExportDetermination.Priority = 2;
oExportDeterminationService.UpdateDetermination(oExportDetermination);
- Retrieve all available Export Determinations:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ExportDeterminationService oExportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ExportDeterminationService);
ExportDeterminationsParams oExportDeterminationsParams = oExportDeterminationService.GetDataInterface(ExportDeterminationServiceDataInterfaces.edsExportDeterminationsParams);
var oExportDeterminations = oExportDeterminationService.GetDeterminations(oExportDeterminationsParams);
for (int i = 0; i < oExportDeterminations.Count; ++i)
{
var ExportDetermination = oExportDeterminations.Item(i);
var AbsEntry = ExportDetermination.AbsEntry;
var Code = ExportDetermination.Code;
var Priority = ExportDetermination.Priority;
var BusinessPartner = ExportDetermination.BusinessPartner;
var Country = ExportDetermination.Country;
var Series = ExportDetermination.Series;
var DocumentType = ExportDetermination.DocumentType;
var ExportFormat = ExportDetermination.ExportFormat;
var PathFileName = ExportDetermination.PathFileName;
}
- Delete an Export Determination:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ExportDeterminationService oExportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ExportDeterminationService);
ExportDeterminationParams oExportDeterminationParams = oExportDeterminationService.GetDataInterface(ExportDeterminationServiceDataInterfaces.edsExportDeterminationParams);
oExportDeterminationParams.Code = ElectronicDocProtocolCodeStrEnum.edpcs_PEPPOL;
oExportDeterminationParams.AbsEntry = 3;
ExportDetermination oExportDetermination = oExportDeterminationService.GetDetermination(oExportDeterminationParams);
oExportDeterminationService.DeleteDetermination(oExportDeterminationParams);
Subscribe
Login
Please login to comment
0 Comments