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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Current Company Language id in Aot Query range value

(0) ShareShare
ReportReport
Posted on by 2,426

Good Evening

As i am trying to apply some range on Aot Query - Language Id - (SysQueryRangeUtil::currentLanguageId())

But this is not working.

How can i apply in range for current company - Language id

Regards,

Have a nice day.

I have the same question (0)
  • Suggested answer
    codenamed22 Profile Picture
    15 on at

    You can solve this issue by joining the translation table with the company info table on the basis of language id.

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi,

    Please note, If you used your query in the dialog in UI, you probably already saved last selection and keep using old value even if you changed it code. To resolve it, you need to reset query or reset usage data.

  • Martin Dráb Profile Picture
    238,291 Most Valuable Professional on at

    Sorry, my mistake. It actually works exactly as it should.

    Try reproducing my case. Create a simple query with just EcoResProductTranslation and add a range there. Than test the result. I used this code:

    Query q = new Query(queryStr(MyQuery));
    
    info(q.dataSourceNo(1).toString());
    
    q.dataSourceNo(1).addGroupByField(fieldNum(EcoResProductTranslation, LanguageId));
    
    QueryRun qr = new QueryRun(q);
    while (qr.next())
    {
    	EcoResProductTranslation t = qr.getNo(1);
    	info(t.LanguageId);
    }

    The method was called and the range was applied as expected.

  • Martin Dráb Profile Picture
    238,291 Most Valuable Professional on at

    It looks correct to me. I've tried to build a simple query on my own and I can confirm that it doesn't work for me either. Let me check if I can find the problem.

  • AX 2012 r3 Profile Picture
    2,426 on at

    pastedimage1583411296641v1.png

  • Martin Dráb Profile Picture
    238,291 Most Valuable Professional on at

    Then I suspect that you're using it wrong. Can you give us a screenshot of your range setup?

  • AX 2012 r3 Profile Picture
    2,426 on at

    Its not working martin

  • WillWU Profile Picture
    22,363 on at

    Hi partner,

    Sorry for that I didn't understand your requirement just now.

    Please try Martin's suggestion.

    You can also try SysQueryRangeUtil::value() and pass a String as the parameter.

  • Martin Dráb Profile Picture
    238,291 Most Valuable Professional on at

    Could you please try (currentLanguageId()) as suggested before? If it doesn't work, it means that either the standard method is broken, or - more likely - you're using it wrong.

  • AX 2012 r3 Profile Picture
    2,426 on at

    Hi Will Wu,

    I cannot use X++ to create Quer because i want view so that i can use that view as datas oource to my Panel.

    Regards

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 405 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 322 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans