How to compare UTCDATETIME with DATE only in reports Filter

How to compare UTCDATETIME with DATE only in reports Filter


Some time we need to companre UTCDateTime with DATE datatype. Generally we faced this issue during reports dialog box.
here is a the solution to compare the UTCDateTime and DATE datatypes in axapta.


public class ReportRun extends ObjectRun
{
    DialogField             DialogFromDate;
    DialogField             DialogToDate;
    DialogField             DialogPaymId;
    UtcDateTime               FromDate;
    UtcDateTime               ToDate;
    Name                    PaymId;

}

public boolean getFromDailog()
{
        ;
        fromDate    = clrSystemDateTime2UtcDateTime(dialogFromDate.value());
        todate      = clrSystemDateTime2UtcDateTime(dialogTodate.value() + 1);
        PaymId      = DialogPaymId.value();
        return true;
}

-Harry

Comments

Popular posts from this blog

Connecting to Databases through X++ PART -I

X++ code for document attachment

Multiple Tables In Query