Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

A circular dependency was detected while processing a data dependency between data sources.

(0) ShareShare
ReportReport
Posted on by 737

Hello,

I created a form with InventTrans and InventTransOrigin as datasource. When I try to run the following code, I getting this error message: "A circular dependency was detected while processing a data dependency between data sources"

Does anyone know how to solve this problem?

Thanks.

[DataSource]
    class InventTrans
    {
        public void init()
        {
            super();
            this.query(new Query(querystr(localQuery)));
            openStatus = this.query().dataSourceTable(tableNum(InventTrans)).findRange(fieldNum(InventTrans,MarkingRefInventTransOrigin));
        
            if (!openStatus)
            {
                openStatus = this.query().dataSourceTable(tableNum(InventTrans)).addRange(fieldnum(InventTrans,MarkingRefInventTransOrigin));
            }
        }

localQuery:

0118.query.png

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: A circular dependency was detected while processing a data dependency between data sources.

    You have form data source forming a query, but your code is trying to ignore this query and use an AOT query instread. Why?

    By the way, you can access the QueryBuildDataSource object by mere this.queryBuildDataSource().

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: A circular dependency was detected while processing a data dependency between data sources.

    Hi Shooowtek,

    You have already added InventTrans and InventTransOrigin table as a datasource to the form. Then what is the purpose of adding the same query again in the init method?

    I think that is the reason for the error.

    If you want to add the range you can directly add the range using queryBuildDataSource of particular datasource in the form.

    Thanks,

    Girish S.

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 Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans