Transfer order reservation entry

Belias
Member Posts: 2,998
I'm really angry with the item tracking: i can't make the transfer order work!
here's how my code looks like:
The problem is that the reservation entries are correctly created, but they're both positive! ](*,)
Thanks in advance for your suggestions!
here's how my code looks like:
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);
The problem is that the reservation entries are correctly created, but they're both positive! ](*,)
Thanks in advance for your suggestions!
0
Comments
-
If I look at code in Codeunit Create Reserv. Entry function CreateReservEntryFor
I noticedInsertReservEntry."Quantity (Base)" := SignFactor(InsertReservEntry) * Quantity;
and In Function SignFactorDATABASE::"Transfer Line": IF ReservEntry."Source Subtype" = 0 THEN // Outbound EXIT(-1) ELSE EXIT(1);
i think you are sending subtype in reverse format
Try// enter in inbound CreateReservEntry.CreateReservEntryFor( 5741,1,DocumentNumber,'',0,ReferenceLineNumber,-1,1,SerialNumber,''); CreateReservEntry.CreateEntry( ItemNumber,'',TransferLine."Transfer-from Code",TransferLine.Description,0D,0D,0,3); // enter in outbound CreateReservEntry.CreateReservEntryFor( 5741,0,DocumentNumber,'',0,ReferenceLineNumber,1,1,SerialNumber,''); CreateReservEntry.CreateEntry( ItemNumber,'',TransferLine."Transfer-to Code",TransferLine.Description,0D,0D,0,3);
0 -
It appears it doesn't work...it creates 2 negative entries, but this doesn't make sense, i'm going to double check my code :shock:
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:0 -
Did you try the code or just a guess?
i think it will work.. please check once..0 -
](*,) ](*,)
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... :-k0 -
Create two Transfer Orders with the same item on it.
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.0 -
bekio wrote:Create two Transfer Orders with the same item on it.
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.I'll give it another try, anyway...but i'm going to smash my laptop if this is not going to work :evil:
0 -
And don't forget that Transfer Orders creates two lines one positive and one negative, positiv is when you pres POST Receive(Tranfer to Location), and negative is when you POST Shippment(Transfer from Location).
:-k0 -
The reference number you are passing ,hope its the transfer line number..
Also the type should be surplus i think. you are passing Prospect.
Please try it once.0 -
MGM08 wrote:The reference number you are passing ,hope its the transfer line number..MGM08 wrote: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!0 -
Belias wrote:MGM08 wrote:The reference number you are passing ,hope its the transfer line number..MGM08 wrote:
i was talking abt ReferenceLineNumber not the table number.the global ReferenceLineNumber was pointing to the tranfer line's Line No i hope.
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!0 -
why did you quote me, MGM? :?
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);0 -
Belias wrote:i found that NAV calls the create CreateReservEntryFor function just one time...I'm wondering how it creates the second reservation0
-
Sorry. For reply i pressed quote.
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.0 -
Try after inserting the first record.
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);0 -
yes, did this thing before going lunch and it appeared to work...
I'm testing it...CurrentSourceRowID := ItemTrackingMgt.ComposeRowID(TBTrackSpec."Source Type", TBTrackSpec."Source Subtype",TBTrackSpec."Source ID", TBTrackSpec."Source Batch Name",TBTrackSpec."Source Prod. Order Line", TBTrackSpec."Source Ref. No."); SecondSourceRowID := ItemTrackingMgt.ComposeRowID(TBTrackSpec."Source Type", 1,TBTrackSpec."Source ID", TBTrackSpec."Source Batch Name",TBTrackSpec."Source Prod. Order Line", TBTrackSpec."Source Ref. No."); ItemTrackingMgt.SynchronizeItemTracking(CurrentSourceRowID,SecondSourceRowID,'');
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions