Project Hour journal creation

Hi all,

I need to create (project) hour journal (AX2012) through code ,it has multiple line entry.The problem is that creation of voucher number.I have found that voucher number is unique if transaction date is same, voucher number is different if date varies (It based on voucher series setup). I need to implement the same in my code, here i am facing difficultly any code for creating voucher number that should behave in the same way how it was handle in hour journal form.

Hi, Select the records order by date from the table and insert it into project hourjournal lines. If date differs, create a new voucher no and insert. Till the time date differs, use the same no and once again if date differs, generate new voucher seq and insert… while select table order by transdate { if (linesdate != table.transdate) { // voucherno = generate new no seq; linesdate = table.transdate; } journallines.voucher = voucherno; journallines.insert(); }