Hi all,
I'm working on syncing Sales Order Headers and Line Items from Dynamics 365 Sales to Business Central, using AL code together with the standard CRM integration framework. The integration is one-way only, from Dynamics Sales to Business Central.
In our production environment, the Sales Order Line Items fail to sync with the following error:
"Dataverse unit is not coupled"
The space in the message suggests that the Unit of Measure is not being assigned—likely coming through as null
or empty, which then causes the validation to fail.
I’ve been attempting to solve this issue via AL code, using event subscriptions such as OnBeforeValidateEvent
, trying to intercept and assign values before the system enforces its standard validations. However, the timing doesn’t seem to allow it—or at least not in a way that resolves the error.
Additionally, I've looked into using integration table field mappings to assign the value, but I’m blocked when trying to map code fields like Unit of Measure. The system throws errors like:
"Field ___ must not have a relationship to another field"
This restricts my ability to set the field through mappings, even though that's where the assignment appears to happen before validation. I’d like to be able to override or assign values to these fields as needed before the validation step, ideally in a supported way.
Strangely, this works as expected in our sandbox environment, but fails in production—despite having similar configurations, which makes me wonder if something environment-specific (like missing couplings, differing unit groups, or sync filters) is contributing to the problem.
To summarize:
I'm trying to solve this in AL code, using event subscriptions like OnBeforeValidateEvent
.
I'm being blocked from assigning values to code fields through integration mappings.
I want a way to assign values before validation fails.
The issue only happens in production, not sandbox.
Any suggestions, guidance, or workarounds would be greatly appreciated!
Siv Sagar
149
Super User 2025 Season 1
Muhammad Shahzad Sh...
61
Most Valuable Professional
Daivat Vartak (v-9d...
53
Super User 2025 Season 1