Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Issue with Sales Order Line Sync from Dynamics 365 Sales to Business Central – Validation issues

(2) ShareShare
ReportReport
Posted on by 20

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!

Categories:
Screenshot_4.png
Screenshot_3.png

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    272 Most Valuable Professional on at
    Issue with Sales Order Line Sync from Dynamics 365 Sales to Business Central – Validation issues
    The error "Dataverse unit is not coupled" means the Unit of Measure (UOM) in Dynamics 365 Sales is not properly linked (coupled) with the corresponding UOM in Business Central in the production environment.
    1. Verify Unit Coupling in Production:
      • Check the Unit of Measure coupling setup between Dynamics 365 and Business Central.
      • Confirm that all units used in Sales Order Lines exist and are correctly mapped in the production environment.
      • Differences between sandbox and production unit groups or missing couplings cause this error.
    2. Mapping Restrictions:
      • Code fields with relationships (like UOM) cannot be mapped directly via integration mappings.
      • This is expected behavior; these fields require proper coupling, not manual mapping.
    3. AL Event Subscriptions Limitation:
      • OnBeforeValidateEvent triggers too late or doesn’t allow overriding coupling logic.
      • Instead, handle unit validation or assign default units earlier in the data flow or during the coupling configuration.
    4. Recommended Approach:
      • Fix the Unit of Measure coupling in production (via Business Central’s integration setup).
      • Ensure all units used in Dynamics 365 are coupled to Business Central units.
      • Avoid trying to override UOM values via AL or mappings — focus on correcting data and coupling.
    The root cause is missing or incorrect UOM coupling in production. Fix unit couplings to resolve the error; AL code or field mappings cannot override this.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 149 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 61 Most Valuable Professional

#3
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 53 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans