Auto Populate the Serial No. on the item tracking lines form

sneha
Member Posts: 191
I’m not going into in detail about the customization. I’m stuck at one point and seeking your help. My need is, I need to AUTO populate the serial number on the sales order item tracking lines form equals to “Sales Order#-Line#” whenever user clicks on the sales order -> Line – Item tracking lines. In which codeunit I can write the code to achieve this?
Sales Line-Reserve, Item Tracking Management,….?
For example, if the sales order is SO1234 and the line number is 10000, the serial number should be populated as SO1234-10000 when user clicks on Sales order -> Line -> Item Tracking Lines
Sales Line-Reserve, Item Tracking Management,….?
For example, if the sales order is SO1234 and the line number is 10000, the serial number should be populated as SO1234-10000 when user clicks on Sales order -> Line -> Item Tracking Lines
0
Comments
-
Thanks for the reply.
We use Item tracking serial number for the inbound items. If we go indetail, we use kit functionality. As part of the build Kit process on sales order, we need to assign the serial number manually for the kit item. We wanted to automate it by auto populating the serial number as Order No-Line No.0 -
sneha wrote:As part of the build Kit process on sales order, we need to assign the serial number manually for the kit item. We wanted to automate it by auto populating the serial number as Order No-Line No.Regards,
Andwian0 -
We need to track the serial number for Kit item as well.0
-
The problem is that this "Form" is generic and is used for different documents. It is hard to change the behavior because bad design. Question is: what you will do when the opening of this form will generate new ser. nos., you close it, change the quantity on the sales line, open it again - it should generate new nos. for the added quantity? What about decrease the quantity on the sales line? What you will do with the "not used" serial nos.?0
-
I agree. I’m fighting a lot to find an easy way to figure it out.
In our scenario, each sales line contains only one quantity. When user opens up a Item tracking line form, we should auto populate the serial no as Order No. – Line No. And, user may modify the serial no if needed. When user opens up the item tracking form again, it should show the last modified serial no.0 -
THan what about function over the line, which will in some event generate the needed reservation entry with new serial no.? Skip the form, do it before you open the form itself, do it in some function triggered manually/automatically in some pre-selected event...0
-
I've done this on the PO side when the order is released. You could do the same for the SO I suppose. I believe that once the serials are there, in order to reduce the quantity, you have to manually go into Item Tracking Lines to delete some lines first. I will try and find the code for it this morning, but I believe you should start by calling functions in the Create Reservation codeunit.0
-
This is my solution, it works (if i've not forgot some piece of code)
CUCreateReservEntry.SetDates(0D,0D); CUCreateReservEntry.SetApplyFromEntryNo(0); lTBTrackSpec."Serial No." := Myserialno; // Document no. + '-' + line no. lTBTrackSpec."Serial No. Substituted" := ''; lTBTrackSpec."Vendor Warranty Date" := 0D; lTBTrackSpec."Vendor Lot No." := ''; lTBTrackSpec."Vendor Serial No." := ''; CASE INTTableNo OF DATABASE::"Purchase Line": BEGIN CUCreateReservEntry.CreateReservEntryFor(INTTableNo,INTDocType,CDDocNo,'',0,INTLineNo,1,1,CDSerNo,''); CUCreateReservEntry.CreateEntry(TBPurchLine."No.",'',TBPurchLine."Location Code",TBPurchLine.Description,0D,0D,0,3); ..... END;
This works for purchase lines. You've to play with tableno, doctype, quantities etc. in order to make it work for the sales lines, too.
And good luck, as kine said, it's a pain to modify this functionality and i hope this is the only customization you need
I know the code is a bit dirty with prefixes etc, but i hope that the names of the variables are understandable. Otherwise, just ask me and i'll provide you the list.0 -
CreateReservEntry.SetDates(0D, 0D);
CreateReservEntry.CreateReservEntryFor(...
CreateReservEntry.CreateEntry(...
Where CreateReservEntry is Codeunit 99000830. When doing it through code I recommend creating one manually and one via code then comparing the reservation entries directly. It's really easy to miss something.0 -
Thank you all. All your ideas are very helpful for me to start…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