{"title":"Codeunit 1639 Office Line Generation, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/1639-office-line-generation/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":1639,"name":"Office Line Generation","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/1639-office-line-generation/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/1639-office-line-generation/source/","path":"src/Layers/W1/BaseApp/CRM/Outlook/OfficeLineGeneration.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:1630":{"name":"Office Management","url":"https://jonas-paprotka.de/ref/codeunit/1630-office-management/"},"codeunit:5532":{"name":"Disable Aggregate Table Update","url":"https://jonas-paprotka.de/ref/codeunit/5532-disable-aggregate-table-update/"},"table:1637":{"name":"Office Suggested Line Item","url":"https://jonas-paprotka.de/ref/table/1637-office-suggested-line-item/"},"table:37":{"name":"Sales Line","url":"https://jonas-paprotka.de/ref/table/37-sales-line/"},"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"}},"procs":[{"name":"CreateLinesBasedOnQuantityReferences","line":29,"kind":"procedure","access":"local","params":3,"steps":[[57,"event","OnBeforeCreateLinesBasedOnQuantityReferences",1],[70,"call","SanitizeText",2],[77,"call","SanitizeText",2],[78,"call","SanitizeText",2],[81,"call","FindItemFromText",5],[82,"call","ItemAlreadyFound",2],[83,"call","CalculateMatchStrength",4],[85,"call","FindItemFromText",5],[86,"call","ItemAlreadyFound",2],[87,"call","CalculateMatchStrength",4],[89,"call","ConvertToInteger",2],[91,"call","InsertSuggestedLineItem",5],[94,"call","InsertSuggestedLineItem",5],[98,"call","GetMatchTotals",3],[99,"call","NewLine",0],[104,"ext","codeunit",1630,"GetOfficeAddinTelemetryCategory",0]]},{"name":"CreateLinesBasedOnItemReferences","line":108,"kind":"procedure","access":"local","params":3,"steps":[[127,"event","OnBeforeCreateLinesBasedOnItemReferences",1],[136,"call","SanitizeText",2],[147,"call","PerformSearch",8],[148,"call","InsertSuggestedLineItem",5],[152,"call","GetMatchTotals",3],[153,"call","NewLine",0],[158,"ext","codeunit",1630,"GetOfficeAddinTelemetryCategory",0]]},{"name":"CreateLineItemsOnCloseSuggestedLineItems","line":162,"kind":"procedure","access":"local","params":3,"steps":[[169,"call","InsertLineItemsAndUpdateAggregate",3],[174,"call","NewLine",0],[177,"ext","codeunit",1630,"GetOfficeAddinTelemetryCategory",0]]},{"name":"InsertLineItemsAndUpdateAggregate","line":181,"kind":"procedure","access":"internal","params":3,"steps":[[188,"ext","codeunit",5532,"SetDisableAllRecords",1],[194,"call","InsertLineItem",3],[205,"call","InsertLineItem",3]]},{"name":"FindItemFromText","line":248,"kind":"procedure","access":"local","params":5,"steps":[[270,"call","PerformSearch",8],[275,"call","OmitFirst",3],[276,"call","PerformSearch",8],[279,"call","OmitLast",3],[280,"call","PerformSearch",8],[284,"call","PerformSearch",8]]},{"name":"InsertSuggestedLineItem","line":361,"kind":"procedure","access":"local","params":5,"steps":[[380,"validate",1637,"Quantity"],[381,"write",1637,"Modify",1],[384,"validate",1637,"Line No."],[386,"validate",1637,"Item No."],[388,"validate",1637,"Item Description"],[389,"validate",1637,"Quantity"],[390,"validate",1637,"Matches"],[391,"write",1637,"Insert",1]]},{"name":"InsertLineItem","line":398,"kind":"procedure","access":"local","params":3,"steps":[[407,"call","InsertSalesLine",3],[412,"call","InsertPurchaseLine",3]]},{"name":"InsertSalesLine","line":417,"kind":"procedure","access":"local","params":3,"steps":[[429,"validate",37,"Document Type"],[430,"validate",37,"Document No."],[431,"validate",37,"Line No."],[432,"validate",37,"Sell-to Customer No."],[433,"validate",37,"Type"],[434,"validate",37,"No."],[435,"validate",37,"Quantity"],[436,"write",37,"Insert",1]]},{"name":"InsertPurchaseLine","line":439,"kind":"procedure","access":"local","params":3,"steps":[[451,"validate",39,"Document Type"],[452,"validate",39,"Document No."],[453,"validate",39,"Line No."],[454,"validate",39,"Buy-from Vendor No."],[455,"validate",39,"Type"],[456,"validate",39,"No."],[457,"validate",39,"Quantity"],[458,"write",39,"Insert",1]]},{"name":"PerformSearch","line":491,"kind":"procedure","access":"local","params":8,"steps":[[496,"call","FindItemsByDescription",2],[497,"call","CalculateMatchStrength",4],[505,"call","ResolveItem",3],[506,"call","CalculateMatchStrength",4]]},{"name":"ResolveItem","line":518,"kind":"procedure","access":"local","params":3,"steps":[[537,"call","FindItemsByDescription",2],[547,"call","SanitizeText",2],[550,"call","FindItemFromText",5],[551,"call","CalculateMatchStrength",4],[563,"call","SanitizeText",2],[566,"call","FindItemFromText",5],[567,"call","CalculateMatchStrength",4],[578,"call","FindItemFromText",5]]}]}