Number Sequence for Report Generation.

Hi All,

Can you please help me in creating a Number Sequence Report wise in Ax 2012 .

What I need is each time when I click the menu item button which prints a SSRS report a new nuber sequnce should get generate for that report .

Next time when the same report if printed again should get visible with a new number sequence.

Please help if any one knows the solution ,its very urgent.

Thanks in Advance…

hi

Use This Step to Solve Your Problem

1- create new number seq in basic - > number Seq

2- Create a Class and copy This Code into In (Name is :Next_Number_sequence)

3- in classDeclaration :

public class Next_Number_sequence
{
str My_Serial_Number;
numberSequenceTable numberSequenceTable_new;
}

4- create new method and copy This code :

str Get_Next_Number_Seq(NumberSequence NumberSequence1)
{

;

select NextRec from numberSequenceTable_new where numberSequenceTable_new.NumberSequence==NumberSequence1
My_Serial_Number=numberSequenceTable_new.Format;
My_Serial_Number=strDel(My_Serial_Number,strlen(My_Serial_Number)-strlen(int2str(numberSequenceTable_new.NextRec-1)),strlen(int2str(numberSequenceTable_new.NextRec-1)));
My_Serial_Number=strins(My_Serial_Number,int2str(numberSequenceTable_new.NextRec),1000);
My_Serial_Number=strReplace(My_Serial_Number,"#",“0”);
return My_Serial_Number;
}

5 - call it in your form , Report and …

Next_Number_sequence=new Next_Number_sequence();
InventDim.inventSerialId=Next_Number_sequence.Get_Next_Number_Seq("name of number seq ");