| Docs Help
  AppSource  
Docs  /  NAVAX Drag & Drop Document Attachments  /  Information for Developers

 Dropzone


2024/12/03 • 1 min. to read
If additional tables are added to the document attachments in Business Central via individual programming, the Dropzone must also be extended. For this purpose, the OnAfterGetRecRefFromDocumentAttachment event is available in the "NVXDD Event Mgt." codeunit. Example The following example shows how to add tables from an individual programming, using standard tables as an example.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"NVXDD Event Mgt.", 'OnAfterGetRecRefFromDocumentAttachment', '', false, false)]
local procedure NVXDDEventMgt_OnAfterGetRecRefFromDocumentAttachment(DocumentAttachment: Record "Document Attachment"; var RecordRef: RecordRef)
begin
    case RecordRef.Number of
        Database::Customer:
            begin
                FieldRef := RecordRef.Field(1);
                FieldRef.Value := DocumentAttachment."No.";
            end;
        Database::"Sales Header":
            begin
                FieldRef := RecordRef.Field(1);
                FieldRef.Value := DocumentAttachment."Document Type";
                FieldRef := RecordRef.Field(3);
                FieldRef.Value := DocumentAttachment."No.";
            end;
        Database::"Sales Line":
            begin
                FieldRef := RecordRef.Field(1);
                FieldRef.Value := DocumentAttachment."Document Type";
                FieldRef := RecordRef.Field(3);
                FieldRef.Value := DocumentAttachment."No.";
                FieldRef := RecordRef.Field(4);
                FieldRef.Value := DocumentAttachment."Line No.";
            end;
    end;
end;


Submit feedback for
DE|EN Imprint