web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to remove added datasource from a query by code

(0) ShareShare
ReportReport
Posted on by 1,552

Hi,

If let's say i have a code that says

QueryBuildDataSource = query.AddDatasource(...)

And i want to remove this datasource from the query based on a condition..how can i do it by code?

I can't find a method related to clearing datasource from a query

I have the same question (0)
  • Suggested answer
    Anton Venter Profile Picture
    20,635 Super User 2026 Season 1 on at

    Hi,

    You can use the enabled propery to disable it.

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, Please check this old thread

    community.dynamics.com/.../498807

  • Suggested answer
    GirishS Profile Picture
    27,833 Moderator on at

    Hi,

    You can also refer to the below thread.

    community.dynamics.com/.../remove-added-data-source-to-qbds

    Thanks,

    Girish S.

  • Suggested answer
    Hana Xue Profile Picture
    Microsoft Employee on at

    Hi,

    Supplementary Note:

    In addition, related articles are found for you, you can refer to them. Hope these will  be useful as well!

    How can I delete a dataSource previously added? — mibuso.com

    axapta - Dynamics AX: Disable datasource from form in code while being able to use advanced filter/sort option - Stack Overflow

    Best Regards,

    Hana

    This post is my own opinion and does not necessarily reflect the opinion or view of my company.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 510 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 399

#3
Adis Profile Picture

Adis 251 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans