{"title":"Codeunit 5365 CDS Int. Option Couple, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5365-cds-int-option-couple/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":5365,"name":"CDS Int. Option Couple","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5365-cds-int-option-couple/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5365-cds-int-option-couple/source/","path":"src/Layers/W1/BaseApp/Integration/Dataverse/CDSIntOptionCouple.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:5340":{"name":"CRM Integration Table Synch.","url":"https://jonas-paprotka.de/ref/codeunit/5340-crm-integration-table-synch/"},"codeunit:5335":{"name":"Integration Table Synch.","url":"https://jonas-paprotka.de/ref/codeunit/5335-integration-table-synch/"},"table:5373":{"name":"CRM Full Synch. Review Line","url":"https://jonas-paprotka.de/ref/table/5373-crm-full-synch-review-line/"},"table:5336":{"name":"Integration Field Mapping","url":"https://jonas-paprotka.de/ref/table/5336-integration-field-mapping/"},"codeunit:5336":{"name":"Integration Record Synch.","url":"https://jonas-paprotka.de/ref/codeunit/5336-integration-record-synch/"},"table:5334":{"name":"CRM Option Mapping","url":"https://jonas-paprotka.de/ref/table/5334-crm-option-mapping/"},"codeunit:5330":{"name":"CRM Integration Management","url":"https://jonas-paprotka.de/ref/codeunit/5330-crm-integration-management/"},"table:5330":{"name":"CRM Connection Setup","url":"https://jonas-paprotka.de/ref/table/5330-crm-connection-setup/"}},"procs":[{"name":"OnRun","line":14,"kind":"trigger","steps":[[19,"event","OnBeforeRun",0],[23,"ext","codeunit",5340,"InitConnection",0],[24,"ext","codeunit",5340,"TestConnection",0],[26,"call","PerformScheduledCoupling",1],[28,"ext","codeunit",5340,"CloseConnection",1]]},{"name":"PerformScheduledCoupling","line":49,"kind":"procedure","access":"internal","params":1,"steps":[[55,"ext","codeunit",5335,"BeginIntegrationCoupleJob",3],[60,"ext","table",5373,"FullSynchStarted",3],[62,"call","CoupleRecords",2],[63,"ext","codeunit",5335,"EndIntegrationSynchJob",0],[65,"ext","table",5373,"FullSynchFinished",2]]},{"name":"CoupleRecords","line":69,"kind":"procedure","access":"local","params":2,"steps":[[105,"write",5336,"Insert"],[110,"call","GetMappingNameWithParent",1],[111,"ext","codeunit",5335,"LogMatchBasedCouplingError",2],[111,"call","GetMappingNameWithParent",1],[122,"ext","codeunit",5336,"SplitLocalTableFilter",2],[138,"ext","codeunit",5340,"LoadCRMOption",2],[154,"event","OnBeforeSetMatchingFilter",0],[182,"call","GetNoMatchFoundTelemetryErrorMessage",2],[189,"ext","table",5334,"IsCRMRecordRefMapped",2],[190,"call","GetSingleMatchAlreadyCoupledTelemetryErrorMessage",2],[194,"ext","codeunit",5335,"CoupleOption",2],[198,"ext","table",5334,"GetRecordRefOptionId",1],[202,"call","GetMultipleMatchesFoundTelemetryErrorMessage",2],[221,"ext","codeunit",5330,"CreateNewOptionsInCRM",1],[223,"ext","codeunit",5335,"UpdateSynchJobCounters",2],[224,"ext","codeunit",5335,"LogSynchError",4],[224,"call","GetNoMatchFoundErrorMessage",1],[229,"call","SynchronizeCoupledRecords",3],[231,"call","GetMappingNameWithParent",1]]},{"name":"SynchronizeCoupledRecords","line":234,"kind":"procedure","access":"local","params":3,"steps":[[239,"call","GetMappingNameWithParent",1],[243,"call","GetMappingNameWithParent",1],[246,"ext","codeunit",5330,"EnqueueOptionSyncJobFromIntegrationTable",4],[248,"ext","codeunit",5330,"EnqueueOptionSyncJobToIntegrationTable",4]]},{"name":"GetNoMatchFoundErrorMessage","line":251,"kind":"procedure","access":"local","params":1,"steps":[[253,"call","GetDataverseOrgURL",0]]},{"name":"GetNoMatchFoundTelemetryErrorMessage","line":256,"kind":"procedure","access":"local","params":2,"steps":[[260,"call","GetMatchingFieldNameList",2],[261,"call","GetDataverseOrgURL",0]]},{"name":"GetMultipleMatchesFoundTelemetryErrorMessage","line":264,"kind":"procedure","access":"local","params":2,"steps":[[268,"call","GetMatchingFieldNameList",2],[269,"call","GetDataverseOrgURL",0]]},{"name":"GetSingleMatchAlreadyCoupledTelemetryErrorMessage","line":272,"kind":"procedure","access":"local","params":2,"steps":[[276,"call","GetMatchingFieldNameList",2],[277,"call","GetDataverseOrgURL",0]]},{"name":"GetDataverseOrgURL","line":298,"kind":"procedure","access":"local","params":0,"steps":[[306,"ext","table",5330,"IsEnabled",0]]}]}