Number sequence on click of button

Hi ,

I need number sequence according to button click , i am having two number sequences and there are two radio buttons if i do select first radio button first number sequence should be called and displayed on the field of form in the same way second should be called on selection of another radio button on the same field.

Please suggest solution.

Do I understand correctly that you want to know how to assign numbers from several given number sequences? Or do you have a problem with radio buttons or something?

What’s your version of AX? Is it in a standard table is your own table?

Hi Martin ,

I wanted that on my button click my assigned number sequence should be called for that i used this code " NumberSeq num;

num = NumberSeq::newGetNumFromCode(‘Acco_001’);

table.field = num.num() ;

NumberSeq num;

num = NumberSeq::newGetNumFromCode(‘Acco_002’);

table.field = num.num() "

But when I am clicking the button its increasing the value by 2 on both conditions , how this can be resolved .

Do you have two buttons to handle them separately?

Yes kranti ,two different buttons and on there clicked event two different number sequences.

Try to debug and see what happens in the clicked method.

Add explicit breakpoint; in the clicked to debug the code.

Thanks Kranthi ,

This code is now working fine for me now

NumberSeq numberSeq;


numberSeq = NumberSeq::newGetNumFromCode(‘numbersequencecode’);

Tablename_ds.object(fieldNum(Table, Field)).setValue(numberSeq.num())