June 08, 2013

Generate Next Number Sequence by x++ code





Generate Next Number Sequence by x++ code

When we create a new record from user interface(by using Forms) number sequence handles automatically by system. But Some time we need to assign a number sequence by code, like we create numbers of records by code and in this case we have to take care of number sequence. 
Here a job to create next number from a number sequence by x++ code.

static void theaxapta_Nextnumseq(Args _args)
{
         NumberSeq num;
         
DiscountTable  _DiscountTable; //Table Buffer
        ;
        ttsbegin;
           num = NumberSeq::newGetNum(HrmParameters::numRefJournalNum()); // Parameters Table
          
_DiscountTable.NextNumseq = num.num(); // Next NumberSeq generated
          
_DiscountTable.insert();
          num.used(); // Mark the Number as Used
      ttscommit;
}



//The other Way is by using EDT

static void testnumseq(Args _args)
{
     theaxaptaEDT   _
theaxaptaEDT   ;
     ExtendedTypeId id = TypeID2ExtendedTypeId(TypeId(theaxaptaEDT));//EDT NAME
     NumberSeq num = NumberSeq::newGetNum(NumberSequenceReference::find(id));
     ;
     //
_theaxaptaEDT.NextNumseq = num.num();//NEXT NUM SEQ
     num.used(); // mark the number as used
     info(num.num()); // NEXT NUM SEQ
}


-Harry

June 06, 2013

Changed, and Deprecated Features for Microsoft Dynamics AX 2012

Hi Folk,

As we all know, there are many new changes came in AX2012 and many few are depreciated from earlier version. Recently while searching over internet i come across one book that will provide all such information. Below is the link to download this book.

New, Changed, and Deprecated Features for Microsoft Dynamics AX 2012, available for download here.

-Harry