Friday, 18 September 2020

AX basic functions

 

1. Month Start Date : 
 
TransDate dateInMonth=today();  
         TransDate firstDateOfMonth;  
         firstDateOfMonth = DateStartMth(dateInMonth); 
2. Month End Date :

TransDate dateInMonth=today();  
         TransDate endDateOfMonth;  
         endDateOfMonth= endmth(dateInMonth);

3. Declare a constant :
#Define.MonthName("May")
 Const str monthName = "May";

4. Next month of date:
nextMth(date)
5. Date2Str function
        str        dateStr           = date2Str(this.DueMonthDate,           123, DateDay::Digits2,                                                        DateSeparator::Slash, DateMonth::Digits2,                                                                                   DateSeparator::Slash, DateYear::Digits4);
6. Num2Str function
1.should pass 4 parameters ex:
a = num2str(x,1,2,1,0);
rules:
1st place:1–>shows no effect(minimum no of characters to print)
2nd place:2–>ofter decimal /comma how many characters has to print
3rd place:1–>shows to select either comma or decimal
ex: 1 for point
2 for comma
0 for none


No comments:

Post a Comment

D365FO Entity insert/update issue Update not allowed for field ‘Entity.FieldName’.

Step 1: Make sure fields properties allow edit is yes in Data entity level(In Table level Allow edit is No). Change to Yes in entity fields ...