---
title: "Codeunit 6136 E-Document Create Purch. Doc."
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/6136-e-document-create-purch-doc/
type: codeunit
id: 6136
name: "E-Document Create Purch. Doc."
app: "E-Document Core"
namespace: Microsoft.eServices.EDocument
versions: "23-29"
build: 29.0.54011.55644
countries: "W1, DE, US"
source: "https://jonas-paprotka.de/ref/codeunit/6136-e-document-create-purch-doc/source/?v=28 https://jonas-paprotka.de/ref/codeunit/6136-e-document-create-purch-doc/source/"
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
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/"
---

# Codeunit 6136 E-Document Create Purch. Doc.

JOP-AL, https://jonas-paprotka.de/ref/codeunit/6136-e-document-create-purch-doc/

| | |
| --- | --- |
| App | E-Document Core |
| Namespace | Microsoft.eServices.EDocument |
| Versions | 23-29 |
| Minors | W1 23.0-29.0; DE 23.0-29.0; US 23.0-29.0, [every minor](https://jonas-paprotka.de/ref/codeunit/6136-e-document-create-purch-doc/editions.json) |
| Source file | src/Processing/EDocumentCreatePurchDoc.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| SetSource | (var SourceEDocument2: Record "E-Document"; var SourceDocumentHeader2: RecordRef; var SourceDocumentLine2: RecordRef) | - | internal | 23 | - | - |
| GetCreatedDocument | () | RecordRef | internal | 23-29 | - | - |
| SetSource | (var SourceEDocument2: Record "E-Document"; var SourceDocumentHeader2: RecordRef; var SourceDocumentLine2: RecordRef; SourcePurchaseDocumentType2: Enum "Purchase Document Type") | - | internal | 24-29 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnCreateNewPurchHdrOnBeforeRecRefInsert | (var EDocument: Record "E-Document"; var TempDocumentHeader: RecordRef; var DocumentHeader: RecordRef) | 23-29 | - | - |
| Integration event | OnCreateNewPurchHdrOnBeforeRecRefModify | (var EDocument: Record "E-Document"; var TempDocumentHeader: RecordRef; var DocumentHeader: RecordRef) | 23-29 | - | - |
| Integration event | OnCreateNewPurchLineOnBeforeRecRefInsert | (var EDocument: Record "E-Document"; var TempDocumentHeader: RecordRef; var DocumentHeader: RecordRef; var TempDocumentLine: RecordRef; var DocumentLine: RecordRef) | 23-29 | - | - |
| Integration event | OnCreateNewPurchLineOnBeforeRecRefModify | (var EDocument: Record "E-Document"; var TempDocumentHeader: RecordRef; var DocumentHeader: RecordRef; var TempDocumentLine: RecordRef; var DocumentLine: RecordRef) | 23-29 | - | - |
| Integration event | OnBeforeProcessHeaderFieldsAssignment | (var DocumentHeader: RecordRef; var PurchaseField: Record Field) | 23-29 | - | - |
| Integration event | OnBeforeProcessHeaderFieldsValidation | (var DocumentHeader: RecordRef; var PurchaseField: Record Field) | 23-29 | - | - |
| Integration event | OnBeforeProcessLineFieldsAssignment | (var DocumentHeader: RecordRef; var DocumentLine: RecordRef; var PurchaseField: Record Field) | 23-29 | - | - |
| Integration event | OnBeforeProcessLineFieldsValidation | (var DocumentHeader: RecordRef; var DocumentLine: RecordRef; var PurchaseField: Record Field) | 23-29 | - | - |

## Source

Symbols: Microsoft.E-DocumentCore.symbols.e1d97edc-c239-46b4-8d84-6368bdf67c8b, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-11-20.
AL source 28: https://github.com/microsoft/BCApps, MIT, releases/28.x at 408a4cc8d3a4c54b60464cc14c964479facb9ba0.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
