get number sequence whole value

Dears

Simply , i need to get the full number sequence value like “Invent_11101” for example my code in below

inventTable = InventTable::find(LEVPrintOrder.Lev_ExamTypeCode);
inventNumGroup = InventNumGroup::find(inventTable.BatchNumGroupId);

numberSequenceTable = NumberSequenceTable::find(inventNumGroup.NumberSequenceTable);
seq = new Sequence(numberSequenceTable.Txt,numberSequenceTable.RecId,numberSequenceTable.Lowest,numberSequenceTable.Highest);

;

lEVMakeRelationCoreTable.Lev_BookNumberSeqTo = int2str(seq.currval(LEVPrintOrder.dataAreaId,numberSequenceTable.RecId));

because currval() return integer value only reflect the number sequence ,but i need the whole value like"invent_11101",waiting your reply your help highly appreciated ,thanks

Regards,

Hisham.

hi hisham,

I am new in Ax, I dont know much about number Sequence but i had made a program where in you have to input two values and the sequence will be generated in click of a button. As per your requirement i think you can use my code to generate number sequence and then concatinate with the string and show in you form. If you want to do this way then i can give you code i wrote to generate cheque number and there by you can generate sequence number. let me know if you need this sort of code.

I hope this can help you.

Himanshu.

himanshu_ax@yahoo.com

You may use something like NumberSeq::numInsertFormat(numberSequenceTable.NextRec-1, numberSequenceTable.Format);

I thing you shouldn’t use the Sequence class at all.

Hii ,

Thanks on your reply , could you send me your code for this function? ,waiting for your reply .

KR,

Hisham.

Hi,

Just try the below code,

NumberSeq numberSeq,

TransactionId transactionID // its jst a variable

;

numberseq = NumberSeq::newgetVoucherFromCode(NumberSequenceTable::find("YourNumberSequnceID).NumberSequence;

transactionID = numberSeq.voucher();

the number sequence assign into the transactionID