RE: How to create Item tracking line from C/AL
Hi catiamatos1991,
basically u need to use the codeunit Reservation Management as stated here earlier. The ID is: 99000845
You basically just set the Kind of record you want to create a reservation for, in this example it's the sales order line, therefore the SetSalesLine Function is used, but there are a couple more functions like this.
Then you just have to call the AutoReserve Method and you can leave the rest to NAV and it creates 2 reservation entries for you! One is positive and one negative (input/output)
There is only one thing you need to keep in mind:
I don't know why, but NAV does not set the "Lot No." into the second reservation entry (output - related to your document). You'll need to set this one by yourself, in my example i do this into the last code lines starting with: lcuSalesLineReserve.FilterReservFor(lReservationEntry,pioSalesLine); this returns the just created reservation entry and I had to get the Lot No. from it and write it to the other one to see the information into your item tracking page in the client (generally called by: lines -> item tracking)
I hope that helps!
PS.: I hope you got a developer license to dive into these CU's and research on your own a little bit - it helped me a lot to understand what NAV is doing here!