Active Query Builder support area

Is there any ability to parse a small expression and find out is it correct?

Avatar
  • updated
  • Completed

Hi

Is there any ability to parse small expression and find out is it correct? For example like in your Expression Editor, you put single quotes in criteria if expression isn't correct. I need the same functional but in other place. 

Thanks

Avatar
Andrey Zavyalov, PM

Hello, Valentina.

Yes, this is possible.

Use the QueryBuilder.SQLContext.ParseExpression or the QueryBuilder.SQLContext.ParseLogicalExpression methods to do so. They throw SQLParsingException on parsing an incorrect statement.

Working with the ASP.NET Edition on the client side you can use the QB.Web.Application.validateExpression and QB.Web.Application.validateCondition functions. They accept an expression and a callback function as parameters. The callback function gets the bool valid and string error parameters.