Here's what I'm trying to accomplish:
The user will post a picking list for items in a sales order. The warehouse will (through an interface) tell AX when the item was shipped. In this interface, it will include the serial number of the item it shipped.
I have to unpick the picking line and repick it with the serial number, then I have to post the packing slip for THAT serialized picked line.
Here's my problem:
The code will unpick the items that are picked and create multiple picking lines (split them) and store the serial number on one of those lines (with the new inventDimID). However, when the packing slip gets posted, one of the lines WITHOUT the serial number ends up as StatusIssue = Deducted, and the line with the serial number ends up as StatusIssue = Picked.
I need the line that was picked with the serial number to end up as the line that is "deducted." How do I tell SalesFormLetter_PackingSlip which inventTrans to deduct?
Remember all the inventTrans lines use the same InventTransId. There is only one salesLine on the salesOrder. I've tried storing the new inventDimId for the serialized inventTrans in the salesParmLine table, this does not work. I've tried storing the new inventDimId in the SalesLine that gets passed into the salesFormLetter class. This also does not work.
It seems like the code does a select firstonly on the inventTrans for this inventTransId and statusIssue::Picked. It just uses the first one it finds. Can anyone offer any suggestions??
Thanks!