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)
  • 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.

  • 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

  • Verified answer
    Sohaib Cheema Profile Picture
    47,776 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

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

  • 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.

  • Verified answer
    Sohaib Cheema Profile Picture
    47,776 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

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans