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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to enable or disable joined dataSources on the query

(0) ShareShare
ReportReport
Posted on by 922

Hi there ,

I need a method to enable or disable added datasources to the query, so, the name of the query is CustAccountStatement_FR.

i tried add init() method on the query as bellow :

public void init()
{
Query queryCust = new Query(queryStr(CustAccountStatement_FR));
if(!LedgerParameters::find().MyField)
{
// DimensionAttributeValueSetItemViewDS_ds.enabled(False);

//This.DimensionAttributeValueSetItemViewDS_ds.enabled(False);
queryCust.dataSourceTable(tableNum(TableName)).enabled(False);
}
super();
}

*This post is locked for comments

I have the same question (0)
  • Denis Macchinetti Profile Picture
    16,444 on at

    Hi Alex

    Why you don't set the property direcly on the Datasource?

  • ALAhmed Profile Picture
    922 on at

    Yes ,It has True by default , but we have specific parameter on the ledgerParameter table and if  is not checked disable the new DS added on the query and otherwise.

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 2 on at

    you can find many examples inside standard AX as well as on search engine. definitely that's feasible

    olondono.blogspot.com/.../how-to-enable-or-disable-joined.html

  • Verified answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Alex

    The right syntax is :

    This.query().dataSourceTable(tableNum(TableName)).enabled(False);

    So, don't create a new query, but use the query itself.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans