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

Announcements

News and Announcements icon
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,286 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
    239,874 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,286 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 10

#2
Harisgillani Profile Picture

Harisgillani 4

#2
dserp Profile Picture

dserp 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans