Langsung ke konten utama

Postingan

Menampilkan postingan dari Juni, 2016

Using NOT LIKE in X++ select statements and query ranges

Hi Friends, In this post I'll like to share how to use NOT LIKE operator in X++. LIKE keyword is available in X++ but  NOT LIKE is not directly supported the way it works in SQL. It still can be achieved using X++ select statements as well as in query range values. For illustration, I'll use an example to select all customer group records which do not start with "1" and do not start with "2", using a select statement as well as using a query object in X++. Query Object: If we need to write this in query range , then you need to use the power of expressions in the query range value. Visit  using expressions in query ranges  to get more details. In the expression use '!1*' to define a not like condition and then separate other values  by a comma (,) as a comma will represent an AND condition in the query range expression.  To quickly use the code, here it goes:     CustGroup               custGroup;     Query                   q