General X++ Development

How do I add an OR condition to an X++ select statement?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I add an OR condition to an X++ select statement?

SSunny Vasty75 reputation · answered Aug 13, 2026

Use ||.

X++
CustTable custTable;

while select custTable
    where custTable.CustGroup == '10'
       || custTable.CustGroup == '20'
{
    info(custTable.AccountNum);
}

Once you start mixing && and ||, use parentheses. It saves a lot of time later when somebody has to figure out what the query was supposed to mean.