Thursday 7 March 2019

Few common functions related to Query and dates

Today, I will be discussing about few of the common methods related to query and dates.

Let's begin with it.

Date  related methods 

 -  Year(date  _date) : Method will be used to get year from specified date.
-   mkdate(int _day, int _month, int _year) : Method will be used to make and return a new date
-   mthOfYr(date _date) : Method will be used to get month from the the specified date parameter.
-   dayOfMth(date _date) : Method will be used to get day of the month from the specified date parameter.


Query  related methods 

QueryBuildRange         startAndEndDateRange ;

startAndEndDateRange = this.query().dataSourceTable(tableNum(EmplSickLeaveEncashment)).addRange(FieldNum(EmplSickLeaveEncashment, NextEncashDate));
startAndEndDateRange.value(SysQueryRangeUtil::dateRange(startDate,toDate));
startAndEndDateRange.status(RangeStatus::Hidden);

Here for adding date range we can using dateRange method from SysQueryRangeUtil class.
In order to hide range we can set its status to Hidden by using method of status.


No comments:

Post a Comment

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

Custom Business events Part 3 - (Activate custom business event) in D365 F&O

 In this blog we will discuss about the steps to activate a custom business in D365 F&O. As we know that business event catalog does not...