Skip to content

DocXtender

Since DocX v2.2.9133.1, extended tables/pages not creating subfolder properly

Viewing 3 posts – 1 through 3 (of 3 total)
  • Author
    Posts
  • #8663
    Albert S.

    We added DocX functionality to Service Order previous to upgrade and it was working fine creating a subfolder under the Service Order folder.

    https:/1234.sharepoint.com/sites/CompanyFiles/Shared%20Documents/BusinessCentralUAT/Service%20Header/adyen+screenshot.png

    It is missing the Service Order No. like this:

    https:/1234.sharepoint.com/sites/CompanyFiles/Shared%20Documents/BusinessCentralUAT/Service%20Header/WSC00039/adyen+screenshot.png

    We were told to use the new integration events, but they don’t seem to address the problem.

    Here is the code snippet:

    [EventSubscriber(ObjectType::Codeunit, Codeunit::”IWX DocXtender”, ‘OnGetCustomRecRefFromDocAttachment’, ”, false, false)]

    local procedure OnGetCustomRecRefFromDocAttachmentDocXtender(precDocumentAttachment: Record “Document Attachment”; var prrRecordRef: RecordRef; var lbRecordRefHandled: Boolean);

    var

    ServiceHeader: Record “Service Header”;

     

    begin

    // Set the table for the custom record, when attached documents using drag-and-drop with DocXtender

    if not lbRecordRefHandled then

    case precDocumentAttachment.”Table ID” of

    Database::”Service Header”:

    begin

    prrRecordRef.Open(Database::”Service Header”);

    if ServiceHeader.Get(ServiceHeader.”Document Type”::Order, precDocumentAttachment.”No.”) then begin

    prrRecordRef.GetTable(ServiceHeader);

    lbRecordRefHandled := true;

    end;

    end;

     

    Any help is appreciated on how to correct this or leverage the new integration events here: https://kb.dmsiworks.com/knowledge-base/extension-integration-through-iworks-common/

    #10280
    Albert S.

    Hello, can you please indicate what we are doing wrong?

    #10284
    Travis P.
    Insight Works

    The issue here is that this event sub was previously only needed for filtering the attachment page when you drilldown to see the attachments. But the new version is using the procedure that this event lives inside, to get the document number from the rec ref for the folder structure now as well. So if this event sub is not added when customizing a page with DocXtender, the folders will not show up per document number. Add this extra event subscriber alongside the other one:

    [EventSubscriber(ObjectType::Codeunit, Codeunit::”IWX DocXtender”, ‘OnAfterOpenForRecRef’, ”, false, false)]
        local procedure HandleOnAfterOpenForRecRef(var precDocumentAttachment: Record “Document Attachment”; var prrRecordRef: RecordRef);
        var
            lfrFieldRef: FieldRef;
            lcodRecNo: Code[20];
        begin
            case prrRecordRef.Number() of
                Database::”Service Header”:
                    begin
                        lfrFieldRef := prrRecordRef.Field(3);
                        lcodRecNo := lfrFieldRef.Value();
                        precDocumentAttachment.”No.” := lcodRecNo;
                    end;
            end;
        end;
Viewing 3 posts – 1 through 3 (of 3 total)
  • Sign in below to reply.