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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Query extended range failure: Right parenthesis expected near pos 0. this error is appearing.

(0) ShareShare
ReportReport
Posted on by

hello masters,

i have created a query (below) and when i run it .it gets this error(Query extended range failure: Right parenthesis expected near pos 0. )

q = new Query();
qbds = q.addDataSource(tableNum(InventItemGroupItem));
qbds.name('ItemGroupMaster');
qbds.addRange(fieldNum(InventItemGroupItem, ItemId)).value(strFmt('((%1.%2 == "DAPJCON0001") || (%1.%3 == IG08))',
qbds.name(), fieldStr(InventItemGroupItem, ItemId),
fieldStr(InventItemGroupItem, ItemGroupId)));

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Kavaljeet Singh,

    Try this 

    qbds.addRange(fieldNum(InventItemGroupItem, ItemId)).value(strFmt('((%1.%2 == "DAPJCON0001") || (%1.%3 == "IG08"))',
    qbds.name(),
    fieldStr(InventItemGroupItem, ItemId),
    fieldStr(InventItemGroupItem, ItemGroupId)));


    So you forgot to put "" around IG08

  • Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    Crispin, the extra parentheses are necessary for the extended query range syntax. In your case, AX would simply look for ItemId with the given value ("InventItemGroupItem.ItemId == ..."), it wouldn't interpret it as SQL.

  • Community Member Profile Picture
    on at

    @ievgen  Thanks you got it write, you spotted the mistake.

  • Community Member Profile Picture
    on at

    Hi,

    @Martin thanks for the reply.

    Can u suggest more about Extended query range  

  • Mea_ Profile Picture
    60,284 on at

    There is a good article explaining how to use them www.axaptapedia.com/Expressions_in_query_ranges

  • Community Member Profile Picture
    on at

    this is the same article Martin has suggested

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…

Neeraj Kumar – Community Spotlight

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

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans