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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Query Table Range

(0) ShareShare
ReportReport
Posted on by 2,147

I am working with a table LedgerEntryJournal that does not have company (dataareaid) information.  I am joining with LedgerJournalTable that has company information.  When joining these tables I need to only pull current company information from the LedgerJournalTable.  Is there a function or syntax that I can use to do this in the range properties?  I do not want to hard code the company because this query will be used with other companies.  Any help would be appreciated.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    48,972 User Group Leader on at
    RE: Query Table Range

    you may use curExt() to get current dataareaId

    msdn.microsoft.com/.../aa887473.aspx

    if you are using  visual AOT query you can also use (currentCompany()) of SysQueryRangeUtil

  • Tremor Olaes Profile Picture
    2,147 on at
    RE: Query Table Range

    Thanks Sohaib for responding.  I tried that but it did not work.  I tried (currentCompany()) and it worked.

  • Tremor Olaes Profile Picture
    2,147 on at
    RE: Query Table Range

    I meant to say I tried curExt()  but it did not work.  I tried (currentCompany()) and it worked.  Thanks again!

  • Verified answer
    Sohaib Cheema Profile Picture
    48,972 User Group Leader on at
    RE: Query Table Range

    Yes, it because curExt() is used in x++ for x++ queries for AOT queries use of SysQueryRangeUtil class is supported.

    You may mark answer verified if you think it has satisfied your requirement.

  • Tremor Olaes Profile Picture
    2,147 on at
    RE: Query Table Range

    Hi Sohaib,

    I was able to create a query that uses the (currentCompany())  in the table range.  I then used the query in a view.  For some reason, when I switch from one company to another, the view still shows data from the last company.  Is there another configuration I am missing?

    Thanks,

    Tremor

  • Tremor Olaes Profile Picture
    2,147 on at
    RE: Query Table Range

    If I make a change to the query it updates compiles and view works.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans