Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to enable or disable joined dataSources on the query

Posted on by 910

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

  • Verified answer
    Denis Macchinetti Profile Picture
    Denis Macchinetti 16,444 on at
    RE: How to enable or disable joined dataSources on the query

    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.

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: How to enable or disable joined dataSources on the query

    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

  • ALAhmed Profile Picture
    ALAhmed 910 on at
    RE: How to enable or disable joined dataSources on the query

    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.

  • Denis Macchinetti Profile Picture
    Denis Macchinetti 16,444 on at
    RE: How to enable or disable joined dataSources on the query

    Hi Alex

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans