Friday, February 17, 2023

Get current date EOD in D365FO X++

//It can also changed to COMPANY TIMEZONES 

public static utcDateTime endOfDay(utcDateTime _dateTime)

    {

        Timezone userTimeZone = DateTimeUtil::getUserPreferredTimeZone();

        utcDateTime dateInTimeZone = DateTimeUtil::applyTimeZoneOffset(_dateTime, userTimeZone);


        return DateTimeUtil::newDateTime(DateTimeUtil::date(dateInTimeZone), timeMax(), userTimeZone);

    }


No comments:

Post a Comment

Disabling the flight in D365FO (CHD - Tier 1)

 INSERT INTO dbo.SYSFLIGHTING(FLIGHTNAME, ENABLED)  VALUES ('<FlightObjectName>_KillSwitch', 1)  or  INSERT INTO dbo.SYSFLIGHT...