General X++ Development

How do I use multiple where conditions in X++?

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

How do I use multiple where conditions in X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

Use && when all conditions must be true.

X++
SalesTable salesTable;

while select salesTable
    where salesTable.CustAccount == 'US-001'
       && salesTable.SalesStatus == SalesStatus::Backorder
{
    info(salesTable.SalesId);
}

Keep the filtering in the query whenever possible instead of returning a bunch of rows and filtering them afterward in X++.