{"title":"Codeunit 5345 Integration Rec. Synch. Invoke, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5345-integration-rec-synch-invoke/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":5345,"name":"Integration Rec. Synch. Invoke","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5345-integration-rec-synch-invoke/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5345-integration-rec-synch-invoke/source/","path":"src/Layers/W1/BaseApp/Integration/SynchEngine/IntegrationRecSynchInvoke.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:5338":{"name":"Integration Record Management","url":"https://jonas-paprotka.de/ref/codeunit/5338-integration-record-management/"},"table:5335":{"name":"Integration Table Mapping","url":"https://jonas-paprotka.de/ref/table/5335-integration-table-mapping/"},"codeunit:5336":{"name":"Integration Record Synch.","url":"https://jonas-paprotka.de/ref/codeunit/5336-integration-record-synch/"},"codeunit:5330":{"name":"CRM Integration Management","url":"https://jonas-paprotka.de/ref/codeunit/5330-crm-integration-management/"},"codeunit:8612":{"name":"Config. Template Management","url":"https://jonas-paprotka.de/ref/codeunit/8612-config-template-management/"},"table:1302":{"name":"Dimensions Template","url":"https://jonas-paprotka.de/ref/table/1302-dimensions-template/"},"table:5339":{"name":"Integration Synch. Job Errors","url":"https://jonas-paprotka.de/ref/table/5339-integration-synch-job-errors/"},"codeunit:5397":{"name":"CDS Transformation Rule Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/5397-cds-transformation-rule-mgt/"},"table:5325":{"name":"Table Config Template","url":"https://jonas-paprotka.de/ref/table/5325-table-config-template/"},"table:5326":{"name":"Int. Table Config Template","url":"https://jonas-paprotka.de/ref/table/5326-int-table-config-template/"}},"procs":[{"name":"OnRun","line":14,"kind":"trigger","steps":[[16,"call","CheckContext",0],[17,"call","SynchRecord",8]]},{"name":"GetContext","line":60,"kind":"procedure","params":5,"steps":[[62,"call","CheckContext",0]]},{"name":"WasModifiedAfterLastSynch","line":70,"kind":"procedure","params":2,"steps":[[75,"call","GetRowLastModifiedOn",2],[78,"ext","codeunit",5338,"IsModifiedAfterIntegrationTableRecordLastSynch",4],[83,"ext","codeunit",5338,"IsModifiedAfterRecordLastSynch",3]]},{"name":"SynchRecord","line":106,"kind":"procedure","access":"local","params":8,"steps":[[125,"call","GetCoupledRecord",7],[134,"call","PrepareNewDestination",3],[141,"event","OnWasModifiedAfterLastSynch",1],[143,"call","WasModifiedAfterLastSynch",2],[146,"ext","table",5335,"GetDirection",0],[147,"call","WasModifiedAfterLastSynch",2],[154,"event","OnBeforeIgnoreUnchangedRecordHandled",0],[159,"call","TransferFields",8],[163,"ext","codeunit",5336,"GetWasBidirectionalFieldModified",0],[164,"ext","codeunit",5336,"GetBidirectionalFieldModifiedContext",1],[165,"event","OnUpdateConflictDetected",0],[167,"call","GetFieldNameAndCaption",4],[171,"call","GetFieldNameAndCaption",4],[179,"call","LogSynchError",4],[182,"call","MarkIntegrationRecordAsFailed",5],[191,"ext","codeunit",5336,"GetWasModified",0],[194,"ext","codeunit",5336,"GetWasModified",0],[200,"call","InsertRecord",6],[204,"call","ModifyRecord",7],[208,"call","UpdateIntegrationRecordCoupling",4],[210,"event","OnAfterUnchangedRecordHandled",0],[211,"call","UpdateIntegrationRecordTimestamp",5]]},{"name":"InsertRecord","line":229,"kind":"procedure","access":"local","params":6,"steps":[[234,"event","OnBeforeInsertRecord",0],[236,"ext","codeunit",5330,"IsCRMTable",1],[238,"call","ApplyConfigTemplate",5],[239,"event","OnInsertRecordOnAfterApplyConfigTemplate",0],[241,"call","UpdateIntegrationRecordCoupling",4],[244,"event","OnAfterInsertRecord",0],[248,"call","UpdateIntegrationRecordTimestamp",5]]},{"name":"ModifyRecord","line":254,"kind":"procedure","access":"local","params":7,"steps":[[259,"event","OnBeforeModifyRecord",0],[262,"call","UpdateIntegrationRecordCoupling",4],[264,"event","OnAfterModifyRecord",0],[269,"call","UpdateIntegrationRecordTimestamp",6],[273,"event","OnErrorWhenModifyingRecord",0],[276,"call","RemoveTrailingDots",1],[279,"call","LogSynchError",4],[280,"call","MarkIntegrationRecordAsFailed",5]]},{"name":"ApplyConfigTemplate","line":285,"kind":"procedure","access":"local","params":5,"steps":[[292,"event","OnBeforeDetermineConfigTemplateCode",0],[295,"call","FindIntTableConfigTemplate",2],[297,"call","FindTableConfigTemplate",2],[299,"event","OnBeforeApplyRecordTemplate",0],[302,"ext","codeunit",8612,"UpdateRecord",2],[304,"call","InsertDimensionsFromTemplate",2],[305,"event","OnAfterApplyRecordTemplate",0],[308,"call","LogSynchError",4]]},{"name":"InsertDimensionsFromTemplate","line":315,"kind":"procedure","access":"local","params":2,"steps":[[329,"ext","table",1302,"InsertDimensionsFromTemplates",3]]},{"name":"GetCoupledRecord","line":333,"kind":"procedure","access":"local","params":7,"steps":[[341,"call","FindRecord",5],[355,"event","OnDeletionConflictDetected",0],[357,"event","OnDeletionConflictDetectedSetRecordStateAndSynchAction",0],[362,"call","LogSynchError",4],[363,"call","MarkIntegrationRecordAsFailed",5],[368,"call","PrepareNewDestination",3],[380,"event","OnDeletionConflictSetSynchAction",0]]},{"name":"FindRecord","line":387,"kind":"procedure","access":"internal","params":5,"steps":[[406,"call","FindIntegrationTableRecord",5],[411,"ext","codeunit",5338,"FindRecordIdByIntegrationTableUid",4],[420,"call","FindAndCoupleDestinationRecord",5]]},{"name":"FindCoupledRecord","line":427,"kind":"procedure","access":"internal","params":5,"steps":[[436,"call","FindIntegrationTableRecord",5],[439,"ext","codeunit",5338,"FindRecordIdByIntegrationTableUid",4]]},{"name":"FindAndCoupleDestinationRecord","line":450,"kind":"procedure","access":"local","params":5,"steps":[[452,"event","OnFindUncoupledDestinationRecord",0],[455,"call","UpdateIntegrationRecordCoupling",4],[457,"call","UpdateIntegrationRecordTimestamp",5]]},{"name":"FindIntegrationTableRecord","line":462,"kind":"procedure","access":"local","params":5,"steps":[[468,"ext","codeunit",5338,"FindIntegrationTableUIdByRecordRef",3],[471,"ext","table",5335,"GetRecordRef",2]]},{"name":"LogSynchError","line":486,"kind":"procedure","access":"local","params":4,"steps":[[494,"ext","table",5339,"LogSynchError",4],[496,"ext","table",5339,"LogSynchError",4]]},{"name":"CheckTransferFields","line":504,"kind":"procedure","params":6,"steps":[[509,"event","OnBeforeTransferRecordFields",0],[510,"ext","codeunit",5397,"ApplyTransformations",3],[511,"ext","codeunit",5336,"SetParameters",3],[513,"run","codeunit",5336],[514,"ext","codeunit",5336,"GetWasModified",0],[516,"ext","codeunit",5336,"GetWasBidirectionalFieldModified",0],[521,"event","OnAfterTransferRecordFields",0]]},{"name":"TransferFields","line":526,"kind":"procedure","access":"local","params":8,"steps":[[530,"event","OnBeforeTransferRecordFields",0],[532,"ext","codeunit",5397,"ApplyTransformations",3],[533,"ext","codeunit",5336,"SetParameters",3],[534,"run","codeunit",5336],[535,"ext","codeunit",5336,"GetWasBidirectionalFieldModified",0],[537,"event","OnAfterTransferRecordFields",0],[541,"call","LogSynchError",4],[543,"call","RemoveTrailingDots",1],[544,"call","MarkIntegrationRecordAsFailed",5]]},{"name":"MarkIntegrationRecordAsFailed","line":557,"kind":"procedure","params":5,"steps":[[564,"ext","codeunit",5330,"IsIntegrationRecordChild",1],[568,"ext","codeunit",5338,"MarkLastSynchAsFailure",5]]},{"name":"MarkIntegrationRecordAsFailed","line":571,"kind":"procedure","params":5,"steps":[[579,"ext","codeunit",5330,"IsIntegrationRecordChild",1],[584,"ext","codeunit",5338,"MarkLastSynchAsFailure",5]]},{"name":"UpdateIntegrationRecordCoupling","line":589,"kind":"procedure","access":"local","params":4,"steps":[[598,"event","OnUpdateIntegrationRecordCoupling",1],[613,"ext","codeunit",5338,"UpdateIntegrationTableCoupling",3]]},{"name":"UpdateIntegrationRecordTimestamp","line":622,"kind":"procedure","access":"local","params":6,"steps":[[635,"event","OnUpdateIntegrationRecordTimestamp",1],[640,"ext","codeunit",5330,"IsIntegrationRecordChild",1],[654,"call","GetRowLastModifiedOn",2],[655,"call","GetRowLastModifiedOn",2],[663,"ext","codeunit",5338,"UpdateIntegrationTableTimestamp",7]]},{"name":"FindTableConfigTemplate","line":674,"kind":"procedure","access":"internal","params":2,"steps":[[689,"ext","table",5325,"GetIntegrationTableFilter",0]]},{"name":"FindIntTableConfigTemplate","line":703,"kind":"procedure","access":"internal","params":2,"steps":[[718,"ext","table",5326,"GetTableFilter",0]]}]}