1681542 – Failed to trigger Approval Procedures by User Queries

Symptom

Via DI API or Service Layer, it is not possible to trigger Approval Procedures based on User Queries.

Reproducing the issue

Prerequisite:

Approval Procedures are set up for the document, which is based on the query.

Sample Code:

RetVal = oOrderDoc.GetApprovalTemplates()

If RetVal <> 0 Then
oCompany.GetLastError(RetVal, ErrorMSG)
MsgBox(“Failed : ” & ErrorMSG & ” (” & Str(RetVal) & “)”)
Return
ElseIf (oOrderDoc.Document_ApprovalRequests.Count > 0 And oOrderDoc.Document_ApprovalRequests.ApprovalTemplatesID > 0) Then
oOrderDoc.Document_ApprovalRequests.SetCurrentLine(0)
oOrderDoc.Document_ApprovalRequests.Remarks = “testDI”
End If

The correct information to check that Approval Procedure is in oOrderDoc.Document_ApprovalRequests.ApprovalTemplatesID. If it is triggered, the value should be bigger than 0.

Cause

Limitation

Solution

It is a limitation in the DI API and Service Layer.

The reason why it is not possible to trigger Approval Procedures based on User Queries via DI API and Service Layer is that it is not possible to get the correct value of ApprovalTemplatesID in DI API and Service Layer when the Approval Procedures is based on User Queries.

Note: If you call the function SaveDraftToDocument() on a draft created by an approval procedure based on user query, all approval related information would be lost.

Picture of Trần Văn Sơn

Trần Văn Sơn

Với 18+ năm kinh nghiệm và 50+ dự án thành công, tôi chuyên giải quyết bài toán quản trị từ gốc rễ quy trình và con người. Phương châm của tôi là hướng doanh nghiệp vận hành theo chuẩn SAP B1 toàn cầu, đảm bảo hệ thống vận hành đơn giản, hiệu quả ở hiện tại và dễ dàng nâng cấp, mở rộng trong tương lai.
Thảo luận và chia sẻ kinh nghiệm
Bạn có gặp tình huống tương tự khi sử dụng hệ thống SAP Business One?

Bài có liên quan theo chủ đề đang xem

3777838 – Enhanced “E-Mail” type activities

Symptom Here are the updates to the E-Mail type activities: New Send As options in E-Mail type activities and Send Message window New sending option of Microsoft Outlook New Activity of “Email” Type option in Sent Emails Report – Selection Criteria window Enhanced Emailed checkbox

Xem tiếp »
Scroll to Top