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

Notifications

Announcements

No record found.

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,346 Super User 2025 Season 2 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,827 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans