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 :
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
    49,677 Super User 2026 Season 1 on at

    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

    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

    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
    49,677 Super User 2026 Season 1 on at

    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

    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

    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

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans