Skip to main content

Notifications

Business Central forum
Suggested answer

Dataverse integration Job Queue Entries switches user resulting in error

Posted on by Microsoft Employee

Hi there,

For our implementation of BC and Dynamics 365 Sales professional we have enabled both the "Dataverse connection setup" and the "Microsoft Dynamics 365 Connection Setup". Following the guides, I've enabled them through an administrator account. The Dataverse integration user is listed below.

pastedimage1640941213636v1.png
Figure 1. Dataverse Integration User.

After setup, Job queue entries were created under the name of the admin account I provided. Data was correctly synced.

pastedimage1640941429117v2.png
Figure 2. Job Queue Entries running under the Admin account.

But if (normal) users of the Dynamics CRM make changes to records, the Job Queue Entries are set run from their corresponding account! This lead to errors, since these accounts have no write-privileges in BC. Data is now no longer synced.

pastedimage1640941699772v3.png
Figure 3. Job Queue Entries suddenly running under a normal user account.


Expected behaviour:
The admin account provided when setting up the sync user is responsible for triggering the synchronization task for BC and Dataverse/Dynamics 365. The user account that makes changes to records should not be used to trigger the sync.

Categories:
  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Dataverse integration Job Queue Entries switches user resulting in error

    Hello,

    This is a known issue - job queue entries that are in state On Hold With Inactivity Timeout change the owning user to current user, when the current user performs a CRUD operation on the related record.

    This will be addressed by Microsoft when we get to it.

    Ad-hoc mitigation:

    Sign in as the user who initially set up the Dynamics 365 Sales integration and restart the affected job queue entries. This will change the user back to the correct user who has enough permissions to run the synchronization.

    Other mitigations (if ad-hoc mitigation is not enough)

    If you have a business scenario such that users without effective permissions to run the synchronization (such as Team Member license users) need to perform CRUD operations on invoices, customers, units of measure, sales prices etc. then you have two options:

    - elevate the permissions of these users so that they have the required permissions to run job queue entries and Dynamics 365 Sales integration related codeunits and tables (assign him the same license as the users who can perform these actions have)

    - if you don't want to elevate the permissions of these users, you can write a per tenant extension and have a "job queue management" codeunit, and set it up to constantly run in background (as a recurring job queue entry under the admin user). This codeunit needs to subscribe to event OnAfterEnqueueJobQueueEntry fired by JobQueueEnqueue.Codeunit.al (453), and check if the job queue entry that is being requeued is a Dynamics 365 Sales codeunit and that it has changed the owner to some other user (other than the user who initially set up the synchronization). In this case, from the subscriber code, restart that job queue entry from the subscriber method, and it will get the admin as the owning user again.

    Having this subscriber, you will make sure that the owner of the job queue entries doesn't change.

    Thanks.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans