Home »
AX 2012
,
Job
,
X++
» How to Get a Month Before And a Month After From Specific Date
How to Get a Month Before And a Month After From Specific Date
For Example we have a date "December 12th 2012".
To get a mont after this date, we can use function "nextMth(date _date)".
To get a mont before this date, we can use function "prevMth(date _date)".
This is the complete code :
Static Void PrevNextMth_test()
{
date testDate = str2date("12/12/2012", 123);
;
info(strfmt("This Date : %1, Next Month : %2", testDate, nextMth(testDate)));
info(strfmt("This Date : %1, Last Month : %2", testDate, prevMth(testDate)));
}
result from above job is like this :
Related Posts
How to Get Worker InformationNow in Microsoft Dynamics AX 2012, hcmWorker table just consist of 2 fields. But from this table we can get many information about worker. For example to get name, phone, email, department, position, ... readmore
How to Create Primary Key Table in AX 2012
This step below is to create primary key in a table in AX 2012. It can consist of single field.
1) Create the Table and add required fields to the table as you all knows.
2) Create an Index b ... readmore
Generate Number Sequence In AX 2012static void GenerateNumberSeq(Args _args)
{
NumberSeq numberSeq;
Str salesId;
numberSeq = NumberSeq::newG ... readmore
Create Lookup Worker Filtered by Legal Entity
1. Add a new method in hcmWorker table, and add this script :
public static client void lookupWorkerByLegalEntity(FormStringControl _lookupctrl, Int64 _LegalEntity){ ... readmore
Get Customer InformationTo get customer information is soo easy, it means get information from CustTable. We can get all about customer information just from this table. It will show in below job script :
static void Custo ... readmore
0 comments:
Post a Comment