CreateReservEntry.SetDates(0D,0D); CreateReservEntry.SetApplyFromEntryNo(0); TrackSpec."Serial No. Substituted" := ''; TrackSpec."Vendor Warranty Date" := 0D; TrackSpec."Vendor Lot No." := ''; TrackSpec."Vendor Serial No." := ''; CreateReservEntry.NewFields(TrackSpec); // add values to custom fields - no problem here // enter in inbound CreateReservEntry.CreateReservEntryFor( 5741,0,DocumentNumber,'',0,ReferenceLineNumber,-1,1,SerialNumber,''); CreateReservEntry.CreateEntry( ItemNumber,'',TransferLine."Transfer-from Code",TransferLine.Description,0D,0D,0,3); // I've also tried to copy the first lines of code here, too...without results // enter in outbound CreateReservEntry.CreateReservEntryFor( 5741,1,DocumentNumber,'',0,ReferenceLineNumber,1,1,SerialNumber,''); CreateReservEntry.CreateEntry( ItemNumber,'',TransferLine."Transfer-to Code",TransferLine.Description,0D,0D,0,3);
Comments
I noticed and In Function SignFactor
i think you are sending subtype in reverse format
Try
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I also tried to pass 2 negative values, and the quantity is inserted correctly. Unfortunately, i'm having some problems with the quantity in the tracking lines (nav says that i have to ship 2 qty)
Anyway, this module have been heavily customized...don't lose time on this, i'll post the solution when i'll find it.
Thanks for now! :thumbsup:
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
i think it will work.. please check once..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
(i edited my previous message while you were writing, i think...sorry)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
ok, i just recreated 2 reservation entry that are PERFECTLY the same as 2 entries generated from the page of the transfer order tracking lines.
The thing that drives me creazy is that i can see the two line generated "by standard" in the manually created transfer order, but i can't see my automatically generated reservation entries...there must be some table to fill somewhere else... :-k
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
At first Transfer Order create manuly Item Tracking, and at the second Transfer Order create tracking based on your function.
Go to Reservation Entry table and put the filter on Source ID(No. from first Transfer Order and second Transfer Order xxx|yyy), and compare fields where is your problem.
Mostly is the Source SubType filed that is different, you have to fill it as the first order, if you want it to be visible to your transfer your automatic reservation.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
:-k
Also the type should be surplus i think. you are passing Prospect.
Please try it once.
Now, i've managed to make my lines appear in the order (i guess it was for the "prospect" problem), but i will update the topic within some days when i'll solve the "quantity" problem. Now, i've got something more urgent to do. Thanks for now!
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
By the way, i found that NAV calls the create CreateReservEntryFor function just one time...I'm wondering how it creates the second reservation... :-k
I'm going to drill some more time into this code (item tracking it's the hardest module i've been debugging in nav, so far...i hope you'll never have to do it)
EDIT: NAV CALLS THE FOLLOWING FUNCTION! i'll try to replicate the behaviour, or i'll use a dirty approach (copy the just created reservation entry and the change the fields i need... :-$ )
ItemTrackingMgt.SynchronizeItemTracking(CurrentSourceRowID,SecondSourceRowID,DialogText);
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Also as u said the system calls this functionality "ItemTrackingMgt.SynchronizeItemTracking(CurrentSourceRowID,SecondSourceRowID,DialogText)"
But i prefer the dirty method as u said.
Only changes will be the fields Positive, quantity fields, Source Subtype,The expected date instead of shipment date and LOCATION
If you find any more changes please do update.
CurrentSourceRowID := ItemTrackingMgt.ComposeRowID(5741,
0,Transfer Line.Document No.,
'',0,
Transfer Line.Line No.);
SecondSourceRowID := ItemTrackingMgt.ComposeRowID(5741,
1,Transfer Line.Document No.,
'',0,
Transfer Line.Line No.);
DialogText := '';
Then try to call the function
ItemTrackingMgt.SynchronizeItemTracking(CurrentSourceRowID,SecondSourceRowID,DialogText);
I'm testing it...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog