I am a beginner in AX .I have tried to to execute a code in AOT job.I got an error like this Operand types are not compatible with the operator. and the code which I have tried to work out is as follows.
static void SelectQueryTest(Args _args)
{
int64 countItem;
countItem = (select count(ItemId) from InventTable where InventTable.ItemGroupId== "100").ItemId;
info(strFmt("Count: %1", countItem));
}
Can anyone help me where I have gone wrong.
The field ItemId is a String so you can not assign it to an int64. Replace count(ItemId) with count(RecId) and use this field as your result. Counting records into field RecId is also good practice as it shows your intention very clearly to someone familiar with AX.