Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Wednesday, May 7, 2014

Code to get the line no to grid in Dynamic AX

Hi,

use below code in the create method of the form in data source level.

 select maxOf(SequenceNumber) from dNPhaseLoc where dNPhaseLoc.DNModularID == DNModule.DNModularID;
 if(DNPhase)
      DNPhase.SequenceNumber = dNPhaseLoc.SequenceNumber +1;
  else
        DNPhase.SequenceNumber = 1;

//Just add SequenceNumber as interger field for your table with reference to header datasoure record you need to use where clause.
Thus line no will be created.

Regards,

No comments:

Post a Comment

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...