Skip to Content
avatar image
Former Member

How to update approval template terms

Hi Experts,

How can i update approval template using DI API?. I want to update the terms of my approval template to "ALWAYS". Can u give me the  code for updating an approval template. Thanks.

Regards,

Phoenix Langaman

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 26, 2015 at 08:04 AM

    Hi Phoenix,

    There are some samples in the SDK directory that might be useful:

    C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM DI\CSharp\15.ApprovalStagesAndTemplateServices


    Best regards,

    Pedro Magueija


    View Pedro Magueija's profile on LinkedIn

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Phoenix,

      To "get" a template you need to use the params and the service:

      var oService = (ApprovalTemplatesService)oCompany.GetCompanyService().GetBusinessService(ServiceTypes.ApprovalTemplatesService);

      var oParams = (ApprovalTemplateParams)

          oService.GetDataInterface(

              ApprovalTemplatesServiceDataInterfaces.atsdiApprovalTemplateParams);

      oParams.Code = 1234;

      var oTemplate = oService.GetApprovalTemplate(oParams);

      Then you should do your changes to template and call the service update when done:

      oService.UpdateApprovalTemplate(oTemplate);

      Good luck.


      Best regards,

      Pedro Magueija


      View Pedro Magueija's profile on LinkedIn