Showing posts with label Right parenthesis expected near pos. Show all posts
Showing posts with label Right parenthesis expected near pos. Show all posts

Monday, January 14, 2013

QueryRange error

Some of the time when you are applying expression in a QueryRange, you may get this error.

Query extended range failure: Right parenthesis expected near pos ....

There is a minor fix of this issue.

See the difference in both expressions.

This will produce error. Syntax wise it is correct but there is a minor error.

queryBuildRange.value(strFmt('(ItemType == %1 || ItemId == "%2")', 
    any2int(ItemType::Service),
    queryValue("B-R14")));


This will work fine.


queryBuildRange.value(strFmt('((ItemType == %1) || (ItemId == "%2"))', 
    any2int(ItemType::Service),
    queryValue("B-R14")));



Got the difference in both queries?

Yes, the every sub expression must be enclosed in the round bracket. See in the above one (ItemType == %1 && ItemId == %2), there is no round bracked enclosed with the expression. In the other one brackets are enclosed.

Copied the code from
http://www.axaptapedia.com/Expressions_in_query_ranges