Skip to main content

Notifications

Announcements

No record found.

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,422

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.

  • Suggested answer
    codenamed22 Profile Picture
    15 on at
    RE: Current Company Language id in Aot Query range value

    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,091 on at
    RE: Current Company Language id in Aot Query range value

    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
    231,760 Most Valuable Professional on at
    RE: Current Company Language id in Aot Query range value

    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
    231,760 Most Valuable Professional on at
    RE: Current Company Language id in Aot Query range value

    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,422 on at
    RE: Current Company Language id in Aot Query range value

    pastedimage1583411296641v1.png

  • Martin Dráb Profile Picture
    231,760 Most Valuable Professional on at
    RE: Current Company Language id in Aot Query range value

    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,422 on at
    RE: Current Company Language id in Aot Query range value

    Its not working martin

  • WillWU Profile Picture
    22,352 on at
    RE: Current Company Language id in Aot Query range value

    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
    231,760 Most Valuable Professional on at
    RE: Current Company Language id in Aot Query range value

    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,422 on at
    RE: Current Company Language id in Aot Query range value

    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

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans