{"title":"Codeunit 1322 Correct PstdSalesInv (Yes/No), extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/1322-correct-pstdsalesinv-yes-no/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":1322,"name":"Correct PstdSalesInv (Yes/No)","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/1322-correct-pstdsalesinv-yes-no/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/1322-correct-pstdsalesinv-yes-no/source/","path":"src/Layers/W1/BaseApp/Sales/History/CorrectPstdSalesInvYesNo.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:1303":{"name":"Correct Posted Sales Invoice","url":"https://jonas-paprotka.de/ref/codeunit/1303-correct-posted-sales-invoice/"},"codeunit:27":{"name":"Confirm Management","url":"https://jonas-paprotka.de/ref/codeunit/27-confirm-management/"},"page:43":{"name":"Sales Invoice","url":"https://jonas-paprotka.de/ref/page/43-sales-invoice/"},"page:42":{"name":"Sales Order","url":"https://jonas-paprotka.de/ref/page/42-sales-order/"}},"procs":[{"name":"OnRun","line":19,"kind":"trigger","steps":[[21,"call","CorrectInvoice",1]]},{"name":"CorrectInvoice","line":35,"kind":"procedure","params":1,"steps":[[43,"ext","codeunit",1303,"TestCorrectInvoiceIsAllowed",2],[44,"call","GetRelatedOrder",3],[46,"call","CancelPostedInvoiceAndOpenNewSalesInvoice",1],[51,"call","CancelPostedInvoice",2],[53,"call","CancelPostedInvoice",2],[55,"call","CancelPostedInvoiceAndOpenSalesOrder",2]]},{"name":"CancelPostedInvoiceAndOpenNewSalesInvoice","line":61,"kind":"procedure","access":"local","params":1,"steps":[[68,"ext","codeunit",27,"GetResponse",2],[69,"ext","codeunit",1303,"CancelPostedInvoiceCreateNewInvoice",2],[71,"event","OnCorrectInvoiceOnBeforeOpenSalesInvoicePage",1],[73,"run","page",43]]},{"name":"CancelPostedInvoiceAndOpenSalesOrder","line":80,"kind":"procedure","access":"local","params":2,"steps":[[88,"event","OnCancelPostedInvoiceAndOpenSalesOrderOnBeforeConfirm",0],[89,"ext","codeunit",27,"GetResponse",2],[90,"ext","codeunit",1303,"CancelPostedInvoice",1],[94,"event","OnCorrectInvoiceOnBeforeOpenSalesOrderPage",1],[96,"run","page",42]]},{"name":"CancelPostedInvoice","line":103,"kind":"procedure","access":"local","params":2,"steps":[[108,"ext","codeunit",27,"GetResponse",2],[109,"ext","codeunit",1303,"CancelPostedInvoice",1]]}]}