- This topic has 2 replies, 2 voices, and was last updated 1 year, 8 months ago by Travis P..
-
AuthorPosts
-
7 March 2025 at 1:49 pm #8663ASAlbert 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/
10 March 2025 at 1:21 pm #10280ASAlbert S.Hello, can you please indicate what we are doing wrong?
11 March 2025 at 8:00 am #10284TPTravis P.Insight WorksThe 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);varlfrFieldRef: FieldRef;lcodRecNo: Code[20];begincase prrRecordRef.Number() ofDatabase::”Service Header”:beginlfrFieldRef := prrRecordRef.Field(3);lcodRecNo := lfrFieldRef.Value();precDocumentAttachment.”No.” := lcodRecNo;end;end;end; -
AuthorPosts
- Sign in below to reply.