Tuesday, February 9, 2010

Intrinsic functions in queries

The following code won't compile in AX.

select extCodeTable
    where extCodeTable.ExtCodeTableId == tablenum(CompanyInfo)
    join extCodeValueTable
        where extCodeValueTable.ExtCodeId == extCodeTable.ExtCodeId;


The reason for that is the call to tablenum(CompanyInfo) - compiler doesn't not allow it inside queries. The simplest workaround is to define a variable, assign it with tablenum(CompanyInfo) value and use it in the query.

11 comments:

  1. It is a great article. You will surely like this also because it is a great stufff
    Run 3 | Run 2 | Stick Run 2 | unblocked games

    ReplyDelete