Code to Generate sequence number in MSD axapta


 static void SequenceGeneration(Args _args)  
 {  
 Sequence Seq = new Sequence("X seq",8,10,250,1);  
 print Seq .currval(); // it will Displays the current value of the object  
 while(true)  
 {  
 print Seq.nextval(1);  
 pause;  
 }  
 }