{"title":"Table 1173 Document Attachment, extension points 29","url":"https://jonas-paprotka.de/ref/table/1173-document-attachment/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"table","id":1173,"name":"Document Attachment","app":"Base Application","url":"https://jonas-paprotka.de/ref/table/1173-document-attachment/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/table/1173-document-attachment/source/","path":"src/Layers/W1/BaseApp/Foundation/Attachment/DocumentAttachment.Table.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:1173":{"name":"Document Attachment Mgmt","url":"https://jonas-paprotka.de/ref/codeunit/1173-document-attachment-mgmt/"},"table:1173":{"name":"Document Attachment","url":"https://jonas-paprotka.de/ref/table/1173-document-attachment/"},"codeunit:419":{"name":"File Management","url":"https://jonas-paprotka.de/ref/codeunit/419-file-management/"},"codeunit:4100":{"name":"Temp Blob","url":"https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/"},"codeunit:425":{"name":"Data Compression","url":"https://jonas-paprotka.de/ref/codeunit/425-data-compression/"},"codeunit:9510":{"name":"Document Service Management","url":"https://jonas-paprotka.de/ref/codeunit/9510-document-service-management/"}},"procs":[{"name":"File Name.OnValidate","line":53,"kind":"trigger","steps":[[60,"ext","codeunit",1173,"IsDuplicateFile",6]]},{"name":"Document Flow Purchase.OnValidate","line":122,"kind":"trigger","steps":[[127,"event","OnBeforeValidateDocumentFlowPurchase",1],[131,"call","HasContent",0]]},{"name":"Document Flow Sales.OnValidate","line":140,"kind":"trigger","steps":[[145,"event","OnBeforeValidateDocumentFlowSales",1],[149,"call","HasContent",0]]},{"name":"Document Flow Service.OnValidate","line":172,"kind":"trigger","steps":[[177,"event","OnBeforeValidateDocumentFlowService",1],[181,"call","HasContent",0]]},{"name":"Document Flow Production.OnValidate","line":191,"kind":"trigger","steps":[[193,"call","HasContent",0]]},{"name":"OnInsert","line":217,"kind":"trigger","steps":[[222,"validate",1173,"File Extension"],[222,"ext","codeunit",419,"GetExtension",1],[223,"validate",1173,"File Name"],[223,"ext","codeunit",419,"GetFileNameWithoutExtension",1],[227,"event","OnInsertOnBeforeCheckDocRefID",1],[229,"call","HasContent",0],[232,"validate",1173,"Attached Date"]]},{"name":"ImportAttachment","line":246,"kind":"procedure","params":2,"steps":[[248,"call","ImportFromStream",2],[249,"call","HasContent",0],[252,"validate",1173,"Attached Date"],[256,"write",1173,"Modify"]]},{"name":"Export","line":259,"kind":"procedure","params":1,"steps":[[268,"event","OnBeforeExport",1],[275,"call","HasContent",0],[278,"event","OnBeforeExportAttachment",0],[280,"ext","codeunit",4100,"CreateOutStream",1],[281,"call","ExportToStream",1],[282,"ext","codeunit",419,"BLOBExport",3]]},{"name":"HasPostedDocumentAttachment","line":285,"kind":"procedure","params":1,"steps":[[293,"call","IsPostedDocument",1]]},{"name":"SupportedByFileViewer","line":303,"kind":"procedure","params":0,"steps":[[315,"ext","codeunit",1173,"IsSupportedByFileViewerExtension",2],[317,"ext","codeunit",1173,"IsSupportedByFileViewerFileName",2]]},{"name":"IsPostedDocument","line":324,"kind":"procedure","access":"local","params":1,"steps":[[332,"event","OnAfterIsPostedDocument",0]]},{"name":"SaveAttachment","line":341,"kind":"procedure","params":4,"steps":[[345,"event","OnBeforeSaveAttachment",0],[350,"ext","codeunit",4100,"HasValue",0],[353,"ext","codeunit",4100,"CreateInStream",1],[354,"call","InsertAttachment",4]]},{"name":"SaveAttachment","line":363,"kind":"procedure","params":3,"steps":[[372,"call","SaveAttachmentFromStream",4]]},{"name":"SaveAttachmentFromStream","line":381,"kind":"procedure","params":4,"steps":[[383,"event","OnBeforeSaveAttachmentFromStream",0],[388,"call","InsertAttachment",4]]},{"name":"InsertAttachment","line":391,"kind":"procedure","access":"local","params":4,"steps":[[398,"call","InitFieldsFromRecRef",1],[402,"call","FindUniqueFileName",2],[402,"ext","codeunit",419,"GetFileNameWithoutExtension",1],[402,"ext","codeunit",419,"GetExtension",1],[406,"validate",1173,"File Extension"],[406,"ext","codeunit",419,"GetExtension",1],[407,"validate",1173,"File Name"],[407,"ext","codeunit",419,"GetFileNameWithoutExtension",1],[409,"event","OnInsertAttachmentOnBeforeImportStream",1],[413,"call","ImportFromStream",2],[414,"call","HasContent",0],[418,"event","OnBeforeInsertAttachment",0],[419,"write",1173,"Insert",1]]},{"name":"InitFieldsFromRecRef","line":422,"kind":"procedure","params":1,"steps":[[432,"validate",1173,"Table ID"],[434,"ext","codeunit",1173,"TableHasNumberFieldPrimayKey",2],[437,"validate",1173,"No."],[440,"ext","codeunit",1173,"TableHasDocTypePrimaryKey",2],[443,"ext","codeunit",1173,"TransformAttachmentDocumentTypeValue",2],[444,"validate",1173,"Document Type"],[447,"ext","codeunit",1173,"TableHasLineNumberPrimaryKey",2],[450,"validate",1173,"Line No."],[453,"ext","codeunit",1173,"TableHasVATReportConfigCodePrimaryKey",2],[456,"validate",1173,"VAT Report Config. Code"],[459,"event","OnAfterInitFieldsFromRecRef",0]]},{"name":"FindUniqueFileName","line":462,"kind":"procedure","params":2,"steps":[[469,"ext","codeunit",1173,"IsDuplicateFile",6],[471,"call","GetNextFileName",2]]},{"name":"VATReturnSubmissionAttachmentsExist","line":476,"kind":"procedure","params":1,"steps":[[480,"call","VATReturnAttachmentsExist",2]]},{"name":"VATReturnResponseAttachmentsExist","line":483,"kind":"procedure","params":1,"steps":[[487,"call","VATReturnAttachmentsExist",2]]},{"name":"DownloadZipFileWithVATReturnSubmissionAttachments","line":498,"kind":"procedure","params":2,"steps":[[500,"call","DownloadZipFileWithVATReturnAttachments",3]]},{"name":"DownloadZipFileWithVATReturnResponseAttachments","line":503,"kind":"procedure","params":2,"steps":[[505,"call","DownloadZipFileWithVATReturnAttachments",3]]},{"name":"DownloadZipFileWithVATReturnAttachments","line":508,"kind":"procedure","access":"local","params":3,"steps":[[537,"ext","codeunit",425,"CreateZipArchive",0],[539,"call","HasContent",0],[541,"ext","codeunit",4100,"CreateOutStream",1],[542,"call","ExportToStream",1],[543,"ext","codeunit",4100,"CreateInStream",1],[544,"ext","codeunit",425,"AddEntry",2],[547,"ext","codeunit",4100,"CreateOutStream",1],[548,"ext","codeunit",425,"SaveZipArchive",1],[549,"ext","codeunit",425,"CloseZipArchive",0],[550,"ext","codeunit",4100,"CreateInStream",1]]},{"name":"HasContent","line":560,"kind":"procedure","params":0,"steps":[[564,"event","OnBeforeHasContent",1]]},{"name":"ImportFromStream","line":571,"kind":"procedure","params":2,"steps":[[575,"event","OnBeforeImportFromStream",1]]},{"name":"ExportToStream","line":585,"kind":"procedure","params":1,"steps":[[589,"event","OnBeforeExportToStream",1]]},{"name":"GetAsTempBlob","line":596,"kind":"procedure","params":1,"steps":[[601,"event","OnBeforeGetAsTempBlob",1],[607,"ext","codeunit",4100,"FromRecord",2]]},{"name":"GetContentType","line":610,"kind":"procedure","params":0,"steps":[[615,"event","OnBeforeGetContentType",1]]},{"name":"ViewFile","line":623,"kind":"procedure","params":0,"steps":[[628,"call","GetAsTempBlob",1],[629,"ext","codeunit",4100,"CreateInStream",1]]},{"name":"OpenInOneDrive","line":633,"kind":"procedure","params":1,"steps":[[642,"event","OnBeforeOpenInOneDrive",1],[646,"ext","codeunit",419,"StripNotsupportChrInFileName",1],[651,"ext","codeunit",9510,"OpenInOneDriveFromMedia",3],[653,"ext","codeunit",9510,"EditInOneDriveFromMedia",3],[655,"write",1173,"Modify"],[658,"ext","codeunit",9510,"ShareWithOneDriveFromMedia",3]]}]}