Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Sunday, April 13, 2014

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

Hi,

public void init()
{
    str 30             TimeSheetID;
    DNTimeSheet     LocTimeSheet;
    ;
    super();
    // Check for passed arguments
    if( element.args() )
    {
        // get string parameter
        TimeSheetID = element.args().parm();
        select DNTimeSheet where DNTimeSheet.TimeSheetNum == TimeSheetID;
        ProjectIDFeild.text(ProjID);
        info(strFmt(ProjID));
    }
}

Here TimeSheetID thrown this error.
Solution is  just I declared Str 30 TimSheetID instead of Str TimeSheetID

Regards,

No comments:

Post a Comment

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...