microsoft / microsoft/BCApps

[Extensibility Request][W1][codeunit][6108][E-Document Processing] new events to allow extend "E-Document Type"

Open
#10,512 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved event-request request-for-external Team: Integrations
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Describe the issue

enum "E-Document Type" is extensible, but there is no full support in E-Document to use a new document type.
There are many places to extend. Starting with codeunit "E-Document Processing":

Expected behavior

GetDocSendingProfileForDocRef method:
add a new event

procedure GetDocSendingProfileForDocRef(var RecRef: RecordRef): Record "Document Sending Profile";
var
+    DocumentSendingProfile: Record "Document Sending Profile";
+    IsHandled: Boolean;
begin
    case RecRef.Number of
         ...
+        else
+           IsHandled := false;
+            OnGetDocSendingProfileForDocRef(RecRef, DocumentSendingProfile, IsHandled);
+            if IsHandled then
+                exit(DocumentSendingProfile);
+    end;
end;

+ [IntegrationEvent(false, false)]
+ local procedure OnGetDocSendingProfileForDocRef(var RecRef: RecordRef; var DocumentSendingProfile: Record "Document Sending Profile"; var IsHandled: Boolean)
+ begin
+ end;

GetDocSendingProfileForCustVend method
change scope of the method to public

+ procedure GetDocSendingProfileForCustVend(CustomerNo: Code[20]; VendorNo: Code[20]) DocumentSendingProfile: Record "Document Sending Profile";

GetLines method:
add a new event

procedure GetLines(EDocument: Record "E-Document"; var SourceDocumentLines: RecordRef)
+ var
+     IsHandled: Boolean;
begin
    case EDocument."Document Type" of
         ...
+         else
+             IsHandled := false;
+             OnGetLines(EDocument, SourceDocumentLines, IsHandled);
+     end;
end;

+ [IntegrationEvent(false, false)]
+ local procedure OnGetLines(EDocument: Record "E-Document"; var SourceDocumentLines: RecordRef; var IsHandled: Boolean)
+ begin
+ end;
Steps to reproduce
Additional context

No response

I will provide a fix for a bug
  • I will provide a fix for a bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating codeunit "E-Document Processing" and read GetDocSendingProfileForDocRef, GetDocSendingProfileForCustVend, and GetLines. Confirm how the existing document-type cases work, then implement the requested events and public method scope. Done means extensible document types can provide sending profiles and source lines through these entry points.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.