DTW Administration / Approval Procedures / Approval Templates / Approval Templates
API Approval Template


ApprovalTemplate is a data structure related to the ApprovalTemplatesService.

Source table: OWTM.

Object Model


When the item is ?Wood? or Variance is greater than 15%, approval process will be triggered.
Adding a new approval template with Inventory Counting and Inventory Posting (C#)
Dim oApprovalTemplateStage As ApprovalTemplateStage Dim oApprovalTemplate As ApprovalTemplate Dim oApprovalTemplateParams As ApprovalTemplateParams Dim oApprovalTemplateTerm As ApprovalTemplateTerm 'get new Approval Stage oApprovalTemplate = oApprovalTemplateService.GetDataInterface(ApprovalTemplatesServiceDataInterfaces.atsdiApprovalTemplate) 'set the name of the Approval Template oApprovalTemplate.Name = "My Template" 'add the user that need the approval(userId=3 is "Green") oApprovalTemplate.ApprovalTemplateUsers.Add.UserID= 3 'Add Inventory Counting & Posting documnet oApprovalTemplate.ApprovalTemplateDocuments.Add.DocumentType = ApprovalTemplatesDocumentTypeEnum.atdtInventoryCounting oApprovalTemplate.ApprovalTemplateDocuments.Add.DocumentType = ApprovalTemplatesDocumentTypeEnum.atdtInventoryPosting 'get Approval Stages oApprovalTemplateStage = oApprovalTemplate.ApprovalTemplateStages.Add 'set the code of an existing stage(e.g code=1 the stage name is Accounting) oApprovalTemplateStage.ApprovalStageCode = 1 'include terms in the template oApprovalTemplate.UseTerms = BoYesNoEnum.tYES 'add new term oApprovalTemplateTerm = oApprovalTemplate.ApprovalTemplateTerms.Add 'set the condition to Item Code oApprovalTemplateTerm.ConditionType = ApprovalTemplateConditionTypeEnum.atctItemCode 'set the Operation Type to Equal oApprovalTemplateTerm.OperationType = ApprovalTemplateOperationTypeEnum.opcodeEqual 'set the value oApprovalTemplateTerm.Value = "Wood" 'set the condition to Variance Percent oApprovalTemplateTerm.ConditionType = ApprovalTemplateConditionTypeEnum.atctVariancePercent 'set the Operation Type to Greater Than oApprovalTemplateTerm.OperationType = ApprovalTemplateOperationTypeEnum.opcodeGreaterThan 'set the value oApprovalTemplateTerm.Value = 15 'add Approval Template oApprovalTemplateParams = oApprovalTemplateService.AddApprovalTemplate(oApprovalTemplate)

See Also

SAP® B1 DI-API C# definition

public class ApprovalTemplateClass : IApprovalTemplate, ApprovalTemplate { public virtual SAPbobsCOM.ApprovalTemplateDocuments ApprovalTemplateDocuments { get; } public virtual SAPbobsCOM.ApprovalTemplateQueries ApprovalTemplateQueries { get; } public virtual SAPbobsCOM.ApprovalTemplateStages ApprovalTemplateStages { get; } public virtual SAPbobsCOM.ApprovalTemplateTerms ApprovalTemplateTerms { get; } public virtual SAPbobsCOM.ApprovalTemplateUsers ApprovalTemplateUsers { get; } public virtual int Code { get; } public virtual BoYesNoEnum IsActive { get; set; } public virtual BoYesNoEnum IsActiveWhenUpdatingDocuments { get; set; } public virtual string Name { get; set; } public virtual string Remarks { get; set; } public virtual BoYesNoEnum UseTerms { get; set; } public extern ApprovalTemplateClass(); public virtual extern void FromXMLFile( string bstrFileName); public virtual extern void FromXMLString( string bstrXML); public virtual extern string GetXMLSchema(); public virtual extern void ToXMLFile( string bstrFileName); public virtual extern string ToXMLString(); }

Related information

Approval Template Documents ApprovalTemplateDocuments Collection· Table: WTM3
ApprovalTemplateDocuments is a Data Collection of ApprovalTemplateDocument data structures. Source table: WTM3.
   Parent: Approval Template ApprovalTemplate Object· Table: OWTM

Approval Template Queries ApprovalTemplateQueries Collection· Table: WTM5
ApprovalTemplateQueries is a Data Collection of ApprovalTemplateQuery data structures. Source table: WTM5.
   Parent: Approval Template ApprovalTemplate Object· Table: OWTM

Approval Template Stages ApprovalTemplateStages Collection· Table: WTM2
ApprovalTemplateStages is a Data Collection of ApprovalTemplateStage data structures. Source table: WTM2.
   Parent: Approval Template ApprovalTemplate Object· Table: OWTM

Approval Template Terms ApprovalTemplateTerms Collection· Table: WTM4
ApprovalTemplateTerms is a Data Collection of ApprovalTemplateTerm data structures. Source table: WTM4.
   Parent: Approval Template ApprovalTemplate Object· Table: OWTM

Approval Template Users ApprovalTemplateUsers Collection· Table: WTM1
ApprovalTemplateUsers is a Data Collection of ApprovalTemplateUser data structures. Source table: WTM1.
   Parent: Approval Template ApprovalTemplate Object· Table: OWTM

Approval Templates Service ApprovalTemplatesService Service· Table: OWTM
ApprovalTemplatesService is a business object that manages the Approval of deviations from organization limitations. This object enables to: Add a new Approval Stage to approval process. Get Approval Stage from approval process. Get a list...

SAP® Business One is the trademark(s) or registered trademark(s) of SAP AG in Germany and in several other countries. Icons by Icons8 Contact
This website is not affiliated with, maintained, authorized, endorsed or sponsored by SAP AG or any of its affiliates