{"title":"Codeunit 1540 Workflow Webhook Setup, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/1540-workflow-webhook-setup/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-11-20","object":{"type":"codeunit","id":1540,"name":"Workflow Webhook Setup","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/1540-workflow-webhook-setup/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/1540-workflow-webhook-setup/source/","path":"src/Layers/W1/BaseApp/System/Workflow/WorkflowWebhookSetup.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:1520":{"name":"Workflow Event Handling","url":"https://jonas-paprotka.de/ref/codeunit/1520-workflow-event-handling/"},"codeunit:1521":{"name":"Workflow Response Handling","url":"https://jonas-paprotka.de/ref/codeunit/1521-workflow-response-handling/"},"codeunit:1542":{"name":"Workflow Webhook Responses","url":"https://jonas-paprotka.de/ref/codeunit/1542-workflow-webhook-responses/"},"codeunit:1541":{"name":"Workflow Webhook Events","url":"https://jonas-paprotka.de/ref/codeunit/1541-workflow-webhook-events/"},"codeunit:1502":{"name":"Workflow Setup","url":"https://jonas-paprotka.de/ref/codeunit/1502-workflow-setup/"},"table:1523":{"name":"Workflow Step Argument","url":"https://jonas-paprotka.de/ref/table/1523-workflow-step-argument/"},"codeunit:1530":{"name":"Request Page Parameters Helper","url":"https://jonas-paprotka.de/ref/codeunit/1530-request-page-parameters-helper/"},"table:1502":{"name":"Workflow Step","url":"https://jonas-paprotka.de/ref/table/1502-workflow-step/"},"table:1501":{"name":"Workflow","url":"https://jonas-paprotka.de/ref/table/1501-workflow/"}},"procs":[{"name":"CreateWorkflowDefinition","line":32,"kind":"procedure","params":4,"steps":[[37,"ext","codeunit",1520,"RunWorkflowOnSendCustomerForApprovalCode",0],[38,"call","CreateCustomerApprovalWorkflow",3],[39,"ext","codeunit",1520,"RunWorkflowOnSendItemForApprovalCode",0],[40,"call","CreateItemApprovalWorkflow",3],[41,"ext","codeunit",1520,"RunWorkflowOnSendGeneralJournalBatchForApprovalCode",0],[42,"call","CreateGeneralJournalBatchApprovalWorkflow",3],[43,"ext","codeunit",1520,"RunWorkflowOnSendGeneralJournalLineForApprovalCode",0],[44,"call","CreateGeneralJournalLineApprovalWorkflow",3],[45,"ext","codeunit",1520,"RunWorkflowOnSendItemJournalBatchForApprovalCode",0],[46,"call","CreateItemJournalBatchApprovalWorkflow",3],[47,"ext","codeunit",1520,"RunWorkflowOnSendRequisitionWkshBatchForApprovalCode",0],[48,"call","CreateRequisitionWkshBatchApprovalWorkflow",3],[49,"ext","codeunit",1520,"RunWorkflowOnSendFAJournalBatchForApprovalCode",0],[50,"call","CreateFAJournalBatchApprovalWorkflow",3],[51,"ext","codeunit",1520,"RunWorkflowOnSendPurchaseDocForApprovalCode",0],[52,"call","CreatePurchaseDocumentApprovalWorkflow",3],[53,"ext","codeunit",1520,"RunWorkflowOnSendSalesDocForApprovalCode",0],[54,"call","CreateSalesDocumentApprovalWorkflow",3],[55,"ext","codeunit",1520,"RunWorkflowOnSendVendorForApprovalCode",0],[56,"call","CreateVendorApprovalWorkflow",3]]},{"name":"CreateApprovalWorkflow","line":62,"kind":"procedure","access":"local","params":6,"steps":[[76,"call","InitializeWorkflow",3],[78,"call","CreateEventStep",6],[79,"call","CreateResponseStep",5],[79,"ext","codeunit",1521,"RestrictRecordUsageCode",0],[80,"call","CreateResponseStep",5],[80,"ext","codeunit",1521,"SetStatusToPendingApprovalCode",0],[81,"call","CreateResponseStep",5],[81,"ext","codeunit",1542,"SendNotificationToWebhookCode",0],[84,"call","CreateEventCondition",1],[85,"call","CreateEventStep",6],[85,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[87,"call","CreateResponseStep",5],[87,"ext","codeunit",1521,"AllowRecordUsageCode",0],[88,"call","CreateResponseStep",5],[88,"ext","codeunit",1521,"ReleaseDocumentCode",0],[90,"call","CreateEventCondition",1],[91,"call","CreateEventStep",6],[91,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[93,"call","CreateResponseStep",5],[93,"ext","codeunit",1521,"OpenDocumentCode",0],[95,"call","CreateEventCondition",1],[96,"call","CreateEventStep",6],[96,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[98,"call","CreateResponseStep",5],[98,"ext","codeunit",1521,"AllowRecordUsageCode",0],[99,"call","CreateResponseStep",5],[99,"ext","codeunit",1521,"OpenDocumentCode",0]]},{"name":"CreateCustomerItemApprovalWorkflow","line":102,"kind":"procedure","access":"local","params":6,"steps":[[116,"call","InitializeWorkflow",3],[118,"call","CreateEventStep",6],[119,"call","CreateResponseStep",5],[119,"ext","codeunit",1521,"RestrictRecordUsageCode",0],[120,"call","CreateResponseStep",5],[120,"ext","codeunit",1542,"SendNotificationToWebhookCode",0],[123,"call","CreateEventCondition",1],[124,"call","CreateEventStep",6],[124,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[126,"call","CreateResponseStep",5],[126,"ext","codeunit",1521,"AllowRecordUsageCode",0],[128,"call","CreateEventCondition",1],[129,"call","CreateEventStep",6],[129,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[132,"call","CreateEventCondition",1],[133,"call","CreateEventStep",6],[133,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[135,"call","CreateResponseStep",5],[135,"ext","codeunit",1521,"AllowRecordUsageCode",0]]},{"name":"CreateGeneralJournalBatchApprovalWorkflowSteps","line":138,"kind":"procedure","access":"local","params":6,"steps":[[153,"call","InitializeWorkflow",3],[155,"call","CreateEventStep",6],[156,"call","CreateResponseStep",5],[156,"ext","codeunit",1521,"CheckGeneralJournalBatchBalanceCode",0],[158,"call","CreateEventStep",6],[158,"ext","codeunit",1520,"RunWorkflowOnGeneralJournalBatchBalancedCode",0],[159,"call","CreateResponseStep",5],[159,"ext","codeunit",1521,"RestrictRecordUsageCode",0],[160,"call","CreateResponseStep",5],[160,"ext","codeunit",1542,"SendNotificationToWebhookCode",0],[163,"call","CreateGeneralJournalWorkflowNotificationSteps",2],[166,"call","CreateEventStep",6],[167,"ext","codeunit",1520,"RunWorkflowOnGeneralJournalBatchNotBalancedCode",0],[169,"call","CreateResponseStep",5],[169,"ext","codeunit",1521,"ShowMessageCode",0],[174,"ext","codeunit",1502,"GetGeneralJournalBatchIsNotBalancedMsg",0],[175,"write",1523,"Modify",1]]},{"name":"CreateGeneralJournalLineApprovalWorkflowSteps","line":178,"kind":"procedure","access":"local","params":6,"steps":[[188,"call","InitializeWorkflow",3],[190,"call","CreateEventStep",6],[191,"call","CreateResponseStep",5],[191,"ext","codeunit",1521,"RestrictRecordUsageCode",0],[192,"call","CreateResponseStep",5],[192,"ext","codeunit",1542,"SendNotificationToWebhookCode",0],[195,"call","CreateGeneralJournalWorkflowNotificationSteps",2]]},{"name":"CreateItemJournalBatchApprovalWorkflowSteps","line":198,"kind":"procedure","access":"local","params":6,"steps":[[208,"call","InitializeWorkflow",3],[210,"call","CreateEventStep",6],[211,"call","CreateResponseStep",5],[211,"ext","codeunit",1521,"RestrictRecordUsageCode",0],[212,"call","CreateResponseStep",5],[212,"ext","codeunit",1542,"SendNotificationToWebhookCode",0],[215,"call","CreateItemJournalWorkflowNotificationSteps",2]]},{"name":"CreateRequisitionWkshBatchApprovalWorkflowSteps","line":218,"kind":"procedure","access":"local","params":6,"steps":[[228,"call","InitializeWorkflow",3],[230,"call","CreateEventStep",6],[231,"call","CreateResponseStep",5],[231,"ext","codeunit",1521,"RestrictRecordUsageCode",0],[232,"call","CreateResponseStep",5],[232,"ext","codeunit",1542,"SendNotificationToWebhookCode",0],[235,"call","CreateRequisitionWkshWorkflowNotificationSteps",2]]},{"name":"CreateFAJournalBatchApprovalWorkflowSteps","line":238,"kind":"procedure","access":"local","params":6,"steps":[[248,"call","InitializeWorkflow",3],[250,"call","CreateEventStep",6],[251,"call","CreateResponseStep",5],[251,"ext","codeunit",1521,"RestrictRecordUsageCode",0],[252,"call","CreateResponseStep",5],[252,"ext","codeunit",1542,"SendNotificationToWebhookCode",0],[255,"call","CreateFAJournalWorkflowNotificationSteps",2]]},{"name":"CreateArgumentForEvent","line":258,"kind":"procedure","access":"local","params":1,"steps":[[272,"write",1523,"Insert"]]},{"name":"CreateArgumentForResponse","line":276,"kind":"procedure","access":"local","params":2,"steps":[[290,"write",1523,"Insert"]]},{"name":"CreateEventCondition","line":294,"kind":"procedure","access":"local","params":1,"steps":[[304,"call","GetTableCaption",1],[307,"ext","codeunit",1530,"GetViewFromDynamicRequestPage",3]]},{"name":"CreateEventStep","line":310,"kind":"procedure","access":"local","params":6,"steps":[[320,"call","CreateArgumentForEvent",1],[322,"write",1502,"Insert"]]},{"name":"CreateResponseStep","line":327,"kind":"procedure","access":"local","params":5,"steps":[[337,"call","CreateArgumentForResponse",2],[340,"write",1502,"Insert"]]},{"name":"CreateCustomerApprovalWorkflow","line":344,"kind":"procedure","access":"local","params":3,"steps":[[356,"call","CreateCustomerItemApprovalWorkflow",6],[357,"ext","codeunit",1520,"RunWorkflowOnSendCustomerForApprovalCode",0]]},{"name":"CreateGeneralJournalWorkflowNotificationSteps","line":362,"kind":"procedure","access":"local","params":2,"steps":[[373,"call","CreateEventCondition",1],[374,"call","CreateEventStep",6],[374,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[376,"call","CreateResponseStep",5],[376,"ext","codeunit",1521,"AllowRecordUsageCode",0],[378,"call","CreateEventCondition",1],[379,"call","CreateEventStep",6],[379,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[382,"call","CreateEventCondition",1],[383,"call","CreateEventStep",6],[383,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0]]},{"name":"CreateGeneralJournalBatchApprovalWorkflow","line":387,"kind":"procedure","access":"local","params":3,"steps":[[399,"call","CreateGeneralJournalBatchApprovalWorkflowSteps",6],[400,"ext","codeunit",1520,"RunWorkflowOnSendGeneralJournalBatchForApprovalCode",0]]},{"name":"CreateGeneralJournalLineApprovalWorkflow","line":405,"kind":"procedure","access":"local","params":3,"steps":[[417,"call","CreateGeneralJournalLineApprovalWorkflowSteps",6],[418,"ext","codeunit",1520,"RunWorkflowOnSendGeneralJournalLineForApprovalCode",0]]},{"name":"CreateItemJournalWorkflowNotificationSteps","line":423,"kind":"procedure","access":"local","params":2,"steps":[[434,"call","CreateEventCondition",1],[435,"call","CreateEventStep",6],[435,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[436,"call","CreateResponseStep",5],[436,"ext","codeunit",1521,"AllowRecordUsageCode",0],[438,"call","CreateEventCondition",1],[439,"call","CreateEventStep",6],[439,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[441,"call","CreateEventCondition",1],[442,"call","CreateEventStep",6],[442,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0]]},{"name":"CreateItemJournalBatchApprovalWorkflow","line":445,"kind":"procedure","access":"local","params":3,"steps":[[457,"call","CreateItemJournalBatchApprovalWorkflowSteps",6],[457,"ext","codeunit",1520,"RunWorkflowOnSendItemJournalBatchForApprovalCode",0]]},{"name":"CreateRequisitionWkshWorkflowNotificationSteps","line":462,"kind":"procedure","access":"local","params":2,"steps":[[473,"call","CreateEventCondition",1],[474,"call","CreateEventStep",6],[474,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[475,"call","CreateResponseStep",5],[475,"ext","codeunit",1521,"AllowRecordUsageCode",0],[477,"call","CreateEventCondition",1],[478,"call","CreateEventStep",6],[478,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[480,"call","CreateEventCondition",1],[481,"call","CreateEventStep",6],[481,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0]]},{"name":"CreateRequisitionWkshBatchApprovalWorkflow","line":484,"kind":"procedure","access":"local","params":3,"steps":[[496,"call","CreateRequisitionWkshBatchApprovalWorkflowSteps",6],[496,"ext","codeunit",1520,"RunWorkflowOnSendRequisitionWkshBatchForApprovalCode",0]]},{"name":"CreateFAJournalWorkflowNotificationSteps","line":501,"kind":"procedure","access":"local","params":2,"steps":[[512,"call","CreateEventCondition",1],[513,"call","CreateEventStep",6],[513,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[514,"call","CreateResponseStep",5],[514,"ext","codeunit",1521,"AllowRecordUsageCode",0],[516,"call","CreateEventCondition",1],[517,"call","CreateEventStep",6],[517,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[519,"call","CreateEventCondition",1],[520,"call","CreateEventStep",6],[520,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0]]},{"name":"CreateFAJournalBatchApprovalWorkflow","line":523,"kind":"procedure","access":"local","params":3,"steps":[[535,"call","CreateFAJournalBatchApprovalWorkflowSteps",6],[535,"ext","codeunit",1520,"RunWorkflowOnSendFAJournalBatchForApprovalCode",0]]},{"name":"CreateItemApprovalWorkflow","line":540,"kind":"procedure","access":"local","params":3,"steps":[[552,"call","CreateCustomerItemApprovalWorkflow",6],[553,"ext","codeunit",1520,"RunWorkflowOnSendItemForApprovalCode",0]]},{"name":"CreatePurchaseDocumentApprovalWorkflow","line":558,"kind":"procedure","access":"local","params":3,"steps":[[570,"call","CreateApprovalWorkflow",6],[571,"ext","codeunit",1520,"RunWorkflowOnSendPurchaseDocForApprovalCode",0]]},{"name":"CreateSalesDocumentApprovalWorkflow","line":576,"kind":"procedure","access":"local","params":3,"steps":[[588,"call","CreateApprovalWorkflow",6],[589,"ext","codeunit",1520,"RunWorkflowOnSendSalesDocForApprovalCode",0]]},{"name":"CreateVendorApprovalWorkflow","line":594,"kind":"procedure","access":"local","params":3,"steps":[[606,"call","CreateCustomerItemApprovalWorkflow",6],[607,"ext","codeunit",1520,"RunWorkflowOnSendVendorForApprovalCode",0]]},{"name":"InitializeWorkflow","line":620,"kind":"procedure","access":"local","params":3,"steps":[[627,"ext","codeunit",1541,"WorkflowWebhookResponseReceivedEventCode",0],[628,"ext","codeunit",1502,"InitWorkflow",0],[636,"write",1501,"Insert"]]}]}