{"title":"Table 5062 Attachment, extension points 29","url":"https://jonas-paprotka.de/ref/table/5062-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":5062,"name":"Attachment","app":"Base Application","url":"https://jonas-paprotka.de/ref/table/5062-attachment/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/table/5062-attachment/source/","path":"src/Layers/W1/BaseApp/CRM/Interaction/Attachment.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:4030":{"name":"Client Type Management","url":"https://jonas-paprotka.de/ref/codeunit/4030-client-type-management/"},"table:5062":{"name":"Attachment","url":"https://jonas-paprotka.de/ref/table/5062-attachment/"},"codeunit:9500":{"name":"Sequence No. Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/9500-sequence-no-mgt/"},"codeunit:5069":{"name":"Word Template Interactions","url":"https://jonas-paprotka.de/ref/codeunit/5069-word-template-interactions/"},"page:5084":{"name":"Content Preview","url":"https://jonas-paprotka.de/ref/page/5084-content-preview/"},"codeunit:5052":{"name":"AttachmentManagement","url":"https://jonas-paprotka.de/ref/codeunit/5052-attachmentmanagement/"},"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/"}},"procs":[{"name":"OpenAttachment","line":142,"kind":"procedure","params":3,"steps":[[148,"event","OnBeforeOpenAttachment",1],[152,"call","IsHTML",0],[156,"call","PreviewHTMLContent",1],[166,"ext","codeunit",4030,"GetCurrentClientType",0],[167,"call","ProcessWebAttachment",1]]},{"name":"OpenAttachment","line":170,"kind":"procedure","params":2,"steps":[[172,"call","IsHTML",0],[173,"call","PreviewHTMLContent",1],[181,"call","ProcessWebAttachment",1]]},{"name":"InsertRecord","line":185,"kind":"procedure","params":0,"steps":[[189,"write",5062,"Insert"],[190,"ext","codeunit",9500,"RebaseSeqNo",1],[191,"ext","codeunit",9500,"GetNextSeqNo",1],[192,"write",5062,"Insert"]]},{"name":"ShowAttachment","line":196,"kind":"procedure","params":2,"steps":[[201,"event","OnBeforeShowAttachment",1],[205,"call","IsHTML",0],[206,"call","PreviewHTMLContent",1],[213,"event","OnShowAttachmentOnAfterCalcAttachmentFile",0],[215,"ext","codeunit",5069,"IsWordDocumentExtension",1],[216,"ext","codeunit",5069,"RunMergedDocument",2],[218,"call","ProcessWebAttachment",1]]},{"name":"PreviewHTMLContent","line":221,"kind":"procedure","access":"local","params":1,"steps":[[225,"ext","page",5084,"SetContent",1],[225,"ext","codeunit",5052,"LoadHTMLContent",2]]},{"name":"ExportAttachmentToClientFile","line":230,"kind":"procedure","params":1,"steps":[[241,"ext","codeunit",419,"ServerTempFileName",1],[242,"call","ExportAttachmentToServerFile",1],[244,"ext","codeunit",419,"Magicpath",0],[250,"ext","codeunit",419,"DeleteServerFile",1]]},{"name":"ImportAttachmentFromClientFile","line":255,"kind":"procedure","params":3,"steps":[[263,"call","ImportTemporaryAttachmentFromClientFile",1],[271,"ext","codeunit",5052,"InsertAttachment",1],[275,"ext","codeunit",5052,"InsertAttachment",1],[290,"call","ImportAttachmentFromServerFile",3]]},{"name":"ImportTemporaryAttachmentFromClientFile","line":293,"kind":"procedure","access":"local","params":1,"steps":[[298,"ext","codeunit",419,"BLOBImport",2],[301,"call","SetAttachmentFileFromBlob",1],[304,"ext","codeunit",419,"GetExtension",1],[305,"write",5062,"Modify"]]},{"name":"ExportAttachmentToServerFile","line":313,"kind":"procedure","params":1,"steps":[[319,"event","OnBeforeExportAttachmentToServerFile",1],[332,"ext","codeunit",4100,"FromRecord",2],[334,"ext","codeunit",419,"ServerTempFileName",1],[335,"ext","codeunit",419,"BLOBExportToServerFile",2],[343,"ext","codeunit",419,"GetFileName",1],[343,"call","ConstDiskFileName",0],[344,"ext","codeunit",419,"CopyServerFile",3],[344,"call","GetServerFileName",1],[344,"call","ConstDiskFileName",0]]},{"name":"ExportAttachmentToTempBlob","line":357,"kind":"procedure","params":1,"steps":[[367,"ext","codeunit",4100,"FromRecord",2],[374,"ext","codeunit",419,"BLOBImportFromServerFile",2],[374,"call","GetServerFileName",1],[374,"call","ConstDiskFileName",0]]},{"name":"ImportAttachmentFromServerFile","line":383,"kind":"procedure","params":3,"steps":[[390,"event","OnBeforeImportAttachmentFromServerFile",1],[395,"call","ImportTemporaryAttachmentFromServerFile",1],[409,"ext","codeunit",419,"BLOBImportFromServerFile",2],[410,"call","SetAttachmentFileFromBlob",1],[413,"ext","codeunit",419,"GetExtension",1],[416,"write",5062,"Modify",1],[423,"ext","codeunit",419,"GetExtension",1],[426,"ext","codeunit",419,"CopyServerFile",3],[426,"call","ConstDiskFileName",0],[427,"write",5062,"Modify",1]]},{"name":"ImportAttachmentFromStream","line":435,"kind":"procedure","access":"internal","params":2,"steps":[[437,"call","SetAttachmentFileFromStream",1],[441,"write",5062,"Insert",1]]},{"name":"ImportTemporaryAttachmentFromServerFile","line":446,"kind":"procedure","access":"local","params":1,"steps":[[450,"ext","codeunit",419,"BLOBImportFromServerFile",2],[451,"call","SetAttachmentFileFromBlob",1],[454,"ext","codeunit",419,"GetExtension",1]]},{"name":"RemoveAttachment","line":458,"kind":"procedure","params":1,"steps":[[472,"ext","codeunit",419,"DeleteServerFile",1],[472,"call","ConstDiskFileName",0],[474,"write",5062,"Delete",1]]},{"name":"WizEmbeddAttachment","line":480,"kind":"procedure","params":1,"steps":[[485,"event","OnBeforeWizEmbeddAttachment",1],[495,"call","ImportAttachmentFromServerFile",3],[495,"ext","table",5062,"ConstDiskFileName",0]]},{"name":"WizSaveAttachment","line":505,"kind":"procedure","params":0,"steps":[[511,"event","OnBeforeWizSaveAttachment",1],[523,"call","CopyAttachmentAsFile",2]]},{"name":"ConstDiskFileName","line":529,"kind":"procedure","params":0,"steps":[[531,"event","OnBeforeConstDiskFileName",0]]},{"name":"CopyAttachmentAsFile","line":536,"kind":"procedure","access":"local","params":2,"steps":[[547,"event","OnAfterCopyAttachmentAsFile",0]]},{"name":"LinkToMessage","line":550,"kind":"procedure","params":3,"steps":[[555,"call","SetMessageID",1],[556,"call","SetEntryID",1],[558,"write",5062,"Modify"]]},{"name":"SetMessageID","line":584,"kind":"procedure","params":1,"steps":[[591,"call","Checksum",1]]},{"name":"ReadHTMLCustomLayoutAttachment","line":649,"kind":"procedure","params":3,"steps":[[653,"call","Read",0],[655,"call","ParseHTMLCustomLayoutAttachment",3],[657,"call","ParseHTMLCustomLayoutAttachment",3]]},{"name":"WriteHTMLCustomLayoutAttachment","line":660,"kind":"procedure","params":2,"steps":[[664,"call","GetCustomLayoutCodeLength",0],[666,"call","Write",1],[667,"write",5062,"Modify"]]},{"name":"WriteHTMLCustomLayoutAttachment","line":670,"kind":"procedure","params":2,"steps":[[672,"call","Write",1],[673,"write",5062,"Modify"]]},{"name":"ParseHTMLCustomLayoutAttachment","line":676,"kind":"procedure","access":"local","params":3,"steps":[[681,"call","GetCustomLayoutCodeLength",0]]},{"name":"IsHTMLReady","line":726,"kind":"procedure","params":0,"steps":[[733,"call","IsHTML",0],[738,"call","Read",0]]},{"name":"IsHTMLCustomLayout","line":747,"kind":"procedure","params":0,"steps":[[754,"call","GetCustomLayoutCodeLength",0],[755,"call","IsHTML",0],[758,"call","Read",0]]},{"name":"ProcessWebAttachment","line":782,"kind":"procedure","access":"local","params":1,"steps":[[787,"ext","codeunit",4100,"FromRecord",2],[788,"ext","codeunit",419,"BLOBExport",3],[791,"call","ImportAttachmentFromClientFile",3]]},{"name":"SetAttachmentFileFromBlob","line":802,"kind":"procedure","params":1,"steps":[[807,"ext","codeunit",4100,"ToRecordRef",2]]}]}