Showing posts with label Day Deduct From Given Date. Show all posts
Showing posts with label Day Deduct From Given Date. Show all posts

Monday, May 15, 2023

Day Deduct From Given Date

Hi, 

In this post we will see how to a day from given date time field and for demo purpose used static methods of class DateTimeUtilClass. 

Note: CG_DeductDaysFromDateTime is a runnable class. 

public static void main(Args _args) 

    {    

        utcdatetime dateTime; 

        date        datePart; 

        TimeOfDay   timePart; 

        int         monthPart; 

  

        dateTime = DateTimeUtil::getSystemDateTime(); 

  

        // Deducts one day from current day 

        datePart = DateTimeUtil::date(dateTime) - 1; 

        timePart = DateTimeUtil::time(dateTime); 

        dateTime = DateTimeUtil::newDateTime(dateParttimePart); 

        info(strFmt("New date time is %1", dateTime)); 

  

        dateTime = DateTimeUtil::getSystemDateTime(); 

        dateTime = DateTimeUtil::addDays(dateTime , -1); 

        info(strFmt("New date time is %1", dateTime)); 

    }  

//Substract 1 day to Actual system date DateTimeUtil::addDays(DateTimeUtil::getSystemDateTime(),-1) //Add 1 Month to Actual system date DateTimeUtil::AddMonths(DateTimeUtil::getSystemDateTime(),-1)

How to Retrieve the Purchase Order Number in the LedgerTransAccount Form using X++ in D365 Finance & Operations

 How to Retrieve the Purchase Order Number in the LedgerTransAccount Form using X++ in D365 Finance & Operations [ExtensionOf(tableStr(G...