Hi All,
We are running into a wired situation while processing partial ship/receipt once we changed the No Series for several types of Transactions.
Here we are gonna use two transfer receipts based on one transfer order to show you this situation:
- The transfer order ready to be processed is 'TO1013'
- The previous No Series for 'Transfer Receipt Header' is from 'TR109001' to 'TR109009'.
- The first posted transfer receipt is 'TR109009'.
- The No Series is changed since the previous No Series was used up.
- The new-added No Series for 'Transfer Receipt Header' starts from '109010'.
- So the second posted transder receipt is '109010'.
Here are these two records for 'TR109009' and '109010' in Business Central table-Transfer Receipt Header.
(
timestamp No_ Transfer Order No_
0x00000000000C8F8A 109010 TO1013
0x00000000000C8F90 109011 TO1013
0x00000000000C6F7B TR109007 TO1011
0x00000000000C8F1D TR109009 TO1013
)
- Apparently, in the table, there was a automatic sort on records after changing the No Series.
- The record for the second posted transfer receipt is up ahead of the first posted transfer receipt.
In our code we use:
postRpt.SetRange("Transfer Order No.", Rec.TransferDocNo);
if postRpt.FindLast() then ...
, trying to locate the second posted transfer receipt by using the transfer order number.
Because the two records in Business Central table-Transfer Receipt Header are out of order,
the function-postRpt.FindLast() will always get the record of 'TR109009' (the previous record before changing the No Series), no matter how many new partial receipts have been posted for the same transfer order.
Thus, our code now cannot get the lastest transfer receipt for this transfer order-'TO1013'.
And this problem happens during partial shipment/receipt/invoice for sales order/transfer order.

Report
All responses (
Answers (