Skip to main content

Container and unbounded string (text) fields are not allowed in a WHERE expression in AX

Reason: Axapta does not allow you to use an unbounded string in a where clause

Solution:
You must use a ‘bounded’ string. To do this you must declare your string with a numerical limiter e.g. str 50.
Example:
PurchTable getFirstByCustomerPOId(str 50 customerPOId)
{
PurchTable purchTable;
;
purchTable.selectForUpdate(true);
select firstonly purchTable
where purchTable.My_CustomerPurchaseOrderId == customerPOId;
return purchTable;
}

Comments