Axapta V/s Me

Yet another blog for Dynamics 365 for Finance and Operations. This blog primarily targets the technical readers. I will be sharing my experience with Dynamics AX using code snippets, errors, and solutions, Tips, and tricks.

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

No comments:

Post a Comment

Thanks

Note: Only a member of this blog may post a comment.