{"title":"Codeunit 134 Import Attachment - Inc. Doc., extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/134-import-attachment-inc-doc/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":"codeunit","id":134,"name":"Import Attachment - Inc. Doc.","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/134-import-attachment-inc-doc/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/134-import-attachment-inc-doc/source/","path":"src/Layers/W1/BaseApp/eServices/EDocument/ImportAttachmentIncDoc.Codeunit.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:4100":{"name":"Temp Blob","url":"https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/"},"table:133":{"name":"Incoming Document Attachment","url":"https://jonas-paprotka.de/ref/table/133-incoming-document-attachment/"},"codeunit:419":{"name":"File Management","url":"https://jonas-paprotka.de/ref/codeunit/419-file-management/"},"table:130":{"name":"Incoming Document","url":"https://jonas-paprotka.de/ref/table/130-incoming-document/"},"table:36":{"name":"Sales Header","url":"https://jonas-paprotka.de/ref/table/36-sales-header/"},"table:38":{"name":"Purchase Header","url":"https://jonas-paprotka.de/ref/table/38-purchase-header/"},"table:81":{"name":"Gen. Journal Line","url":"https://jonas-paprotka.de/ref/table/81-gen-journal-line/"},"codeunit:701":{"name":"Data Type Management","url":"https://jonas-paprotka.de/ref/codeunit/701-data-type-management/"}},"procs":[{"name":"OnRun","line":18,"kind":"trigger","steps":[[22,"call","UploadFile",2],[23,"call","ImportAttachment",2]]},{"name":"ImportMultiple","line":43,"kind":"procedure","params":4,"steps":[[53,"call","ImportAttachment",3]]},{"name":"ImportAttachment","line":71,"kind":"procedure","access":"internal","params":3,"steps":[[78,"ext","codeunit",4100,"CreateOutStream",2],[81,"call","CheckFileContentBeforeUploadFile",1],[82,"ext","table",133,"SetContentFromBlob",1]]},{"name":"UploadFile","line":87,"kind":"procedure","params":2,"steps":[[92,"call","CheckFileContentBeforeUploadFile",1],[94,"ext","codeunit",419,"BLOBImportWithFilter",5],[95,"ext","table",133,"SetContentFromBlob",1]]},{"name":"CheckFileContentBeforeUploadFile","line":98,"kind":"procedure","access":"local","params":1,"steps":[[100,"event","OnBeforeUploadFile",0]]},{"name":"ImportAttachment","line":108,"kind":"procedure","params":2,"steps":[[117,"call","FindOrCreateIncomingDocument",2],[120,"ext","codeunit",419,"ServerFileExists",1],[121,"ext","codeunit",419,"BLOBImportFromServerFile",2],[123,"ext","codeunit",419,"BLOBImportFromServerFile",2],[123,"ext","codeunit",419,"UploadFile",2],[125,"call","SaveDocumentAttachment",5]]},{"name":"ImportAttachment","line":128,"kind":"procedure","params":3,"steps":[[136,"call","FindOrCreateIncomingDocument",2],[137,"call","SaveDocumentAttachment",5]]},{"name":"SaveDocumentAttachment","line":140,"kind":"procedure","access":"local","params":5,"steps":[[148,"call","GetIncomingDocumentNextLineNo",1],[152,"ext","codeunit",4100,"ToRecordRef",2],[159,"write",133,"Delete"],[163,"validate",133,"File Extension"],[163,"ext","codeunit",419,"GetExtension",1],[165,"ext","codeunit",419,"GetFileNameWithoutExtension",1],[171,"write",130,"Modify"],[175,"ext","table",133,"OnAttachBinaryFile",0],[177,"write",133,"Insert",1],[178,"event","OnAfterImportAttachment",0]]},{"name":"CreateNewAttachment","line":182,"kind":"procedure","params":1,"steps":[[188,"call","FindOrCreateIncomingDocument",2],[194,"call","GetIncomingDocumentNextLineNo",1]]},{"name":"FindOrCreateIncomingDocument","line":197,"kind":"procedure","access":"local","params":2,"steps":[[202,"call","FindUsingIncomingDocNoFilter",2],[204,"call","FindUsingDocNoFilter",4],[206,"call","CreateIncomingDocument",4]]},{"name":"FindInGenJournalLineUsingIncomingDocNoFilter","line":221,"kind":"procedure","access":"local","params":2,"steps":[[226,"call","CreateNewJournalLineIncomingDoc",1]]},{"name":"FindInSalesPurchUsingIncomingDocNoFilter","line":233,"kind":"procedure","access":"local","params":2,"steps":[[238,"call","CreateNewSalesPurchIncomingDoc",1]]},{"name":"FindUsingIncomingDocNoFilter","line":245,"kind":"procedure","access":"local","params":2,"steps":[[253,"call","FindInIncomingDocAttachmentUsingIncomingDocNoFilter",2],[255,"call","FindInGenJournalLineUsingIncomingDocNoFilter",2],[257,"call","FindInSalesPurchUsingIncomingDocNoFilter",2]]},{"name":"FindUsingDocNoFilter","line":267,"kind":"procedure","access":"local","params":4,"steps":[[290,"event","OnFindUsingDocNoFilterOnBeforeFind",1]]},{"name":"CreateNewSalesPurchIncomingDoc","line":299,"kind":"procedure","access":"local","params":1,"steps":[[310,"event","OnBeforeCreateNewSalesPurchIncomingDoc",1],[325,"call","CreateIncomingDocumentExtended",5],[327,"write",36,"Modify"],[332,"call","CreateIncomingDocumentExtended",5],[334,"write",38,"Modify"]]},{"name":"CreateNewJournalLineIncomingDoc","line":343,"kind":"procedure","access":"local","params":1,"steps":[[359,"call","CreateIncomingDocumentExtended",5],[361,"write",81,"Modify"]]},{"name":"CreateIncomingDocument","line":366,"kind":"procedure","access":"local","params":4,"steps":[[370,"call","CreateIncomingDocumentExtended",5]]},{"name":"CreateIncomingDocumentExtended","line":373,"kind":"procedure","params":5,"steps":[[379,"ext","table",130,"CreateIncomingDocument",2],[381,"call","GetDocType",5],[383,"ext","table",130,"GetRecord",1],[384,"ext","codeunit",701,"GetRecordRef",2],[396,"write",130,"Modify"]]},{"name":"GetDocType","line":399,"kind":"procedure","access":"local","params":5,"steps":[[402,"ext","table",130,"SetPostedDocFields",2],[403,"ext","table",130,"GetRelatedDocType",3],[406,"call","GetUnpostedDocType",2]]},{"name":"GetUnpostedDocType","line":409,"kind":"procedure","access":"local","params":2,"steps":[[411,"call","IsJournalRelated",1],[414,"call","IsSalesPurhaseRelated",1],[415,"call","GetUnpostedSalesPurchaseDocType",2]]},{"name":"GetUnpostedSalesPurchaseDocType","line":420,"kind":"procedure","access":"local","params":2,"steps":[[425,"event","OnBeforeGetUnpostedSalesPurchaseDocType",0]]},{"name":"GetIncomingDocumentNextLineNo","line":466,"kind":"procedure","access":"local","params":1,"steps":[[472,"call","LineIncrement",0]]},{"name":"ProcessAndUploadPicture","line":480,"kind":"procedure","params":2,"steps":[[488,"call","CreateNewAttachment",1],[491,"validate",133,"File Extension"],[496,"write",133,"Insert",1]]}]}