Friday, July 30, 2010

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

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

"Here is a really simple error / solution. I came back to writing X after a few weeks of down time and actually forgot about this as I am predominately a C# programmer.
The problem:
Axapta does not want you to use an unbounded string in a where clause.�
The solution:
You must use a ‘bounded’ string.� To do this you must declare your string with a numerical limiter e.g. str 30.
Example:
PurchTable getFirstByCustomerPOId(str 30 customerPOId)
{
PurchTable purchTable;
;
purchTable.selectForUpdate(true);
select firstonly purchTable
where purchTable.My_CustomerPurchaseOrderId == customerPOId;
return purchTable;
}"

3 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Thanks for the info

    ReplyDelete
  3. Amazing solution.

    ReplyDelete