EmploymentCategoryService in SAP Business One SDK
source link: https://blogs.sap.com/2023/01/23/employmentcategoryservice-in-sap-business-one-sdk/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
EmploymentCategoryService in SAP Business One SDK
EmploymentCategoryService in SAP Business One SDK, is specific to Certificazione Unica for Italy localization.
For details about Certificazione Unica, refer to the following blog: Italy_Certificazione Unica related objects and properties in SAP Business One SDK.
Navigation path in SAP Business One: Business Partner Master Data → Accounting → Tax, select the checkbox Subject to Withholding Tax and go to the field Employment Category.
Below are some samples which you might find useful when using EmploymentCategoryService in SAP Business One DI API:
- Add a new Employment Category:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
SAPbobsCOM.EmploymentCategoryService oEmploymentCategoryService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.EmploymentCategoryService);
SAPbobsCOM.EmploymentCategory oEmploymentCategory = oEmploymentCategoryService.GetDataInterface(SAPbobsCOM.EmploymentCategoryServiceDataInterfaces.ecsEmploymentCategory);
oEmploymentCategory.Code = "Z5";
oEmploymentCategory.Description = "Added via DI";
oEmploymentCategoryService.AddEmploymentCategory(oEmploymentCategory);
- Get and Update an existing Employment Category:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
SAPbobsCOM.EmploymentCategoryService oEmploymentCategoryService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.EmploymentCategoryService);
SAPbobsCOM.EmploymentCategoryParams oEmploymentCategoryParams = oEmploymentCategoryService.GetDataInterface(SAPbobsCOM.EmploymentCategoryServiceDataInterfaces.ecsEmploymentCategoryParams);
SAPbobsCOM.EmploymentCategorysParams oEmploymentCategorysParams = oEmploymentCategoryService.GetDataInterface(SAPbobsCOM.EmploymentCategoryServiceDataInterfaces.ecsEmploymentCategorysParams);
oEmploymentCategoryParams.Code = "Z5";
SAPbobsCOM.EmploymentCategory oEmploymentCategory = oEmploymentCategoryService.GetDataInterface(SAPbobsCOM.EmploymentCategoryServiceDataInterfaces.ecsEmploymentCategory);
oEmploymentCategory = oEmploymentCategoryService.GetEmploymentCategory(oEmploymentCategoryParams);
oEmploymentCategory.Description = "Updated via DI";
oEmploymentCategoryService.UpdateEmploymentCategory(oEmploymentCategory);
- Get list of all the Employment Category:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
SAPbobsCOM.EmploymentCategoryService oEmploymentCategoryService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.EmploymentCategoryService);
SAPbobsCOM.EmploymentCategoryParams oEmploymentCategoryParams = oEmploymentCategoryService.GetDataInterface(SAPbobsCOM.EmploymentCategoryServiceDataInterfaces.ecsEmploymentCategoryParams);
SAPbobsCOM.EmploymentCategorysParams oEmploymentCategorysParams = oEmploymentCategoryService.GetDataInterface(SAPbobsCOM.EmploymentCategoryServiceDataInterfaces.ecsEmploymentCategorysParams);
oEmploymentCategorysParams = oEmploymentCategoryService.GetEmploymentCategoryList();
Note: In Service Layer, refer to the entity EmploymentCategorys for the same.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK