Variant Code field in inventory putaway window

Dr_mjh
Member Posts: 203
Hi everyone:
The variant code field at the inventory putaway window is not editable when you didn't it fill in the purch. order window, so I made it editable in the object designer but this only solve the editability problem; I mean when I post the document the variant that I add doesn't appear at the ledger entries as I didn't add it in first place which is not true and it is completely weired. So please help me with this! ](*,)
The variant code field at the inventory putaway window is not editable when you didn't it fill in the purch. order window, so I made it editable in the object designer but this only solve the editability problem; I mean when I post the document the variant that I add doesn't appear at the ledger entries as I didn't add it in first place which is not true and it is completely weired. So please help me with this! ](*,)
0
Comments
-
The variant field that goes to Item Ledger comes from Purchase/Sales Line not from warehouse documents. you need to write code to update the PO/SO line either during posting, or when the user puts it on putaway document.0
-
Thank you very much, but what is the code unit responsible for such posting process?0
-
Purchase orders, invoices, return orders, credit memos are posted with codeunit 90.
Warehouse receipts are posted with codeunit 5761 or 5762 that calls codeunit 5760. This last codeunit calls codeunit 90 for each purchase order it finds (C80 for sales return orders ; C5705 for receipt of transfer)Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
are you sure about the code unit? because i tried them but it didn't work. ](*,)0
-
I mean that the code unit 5760 is not reflected in the item ledger entries which means that any change in the variant code is not reflected there. So I would really appreciate it if you provide me with the function that make this possible. And thanks for everyone who helped and still helping and will help me in this issue.0
-
Copied from C5760 form Navision 3.10A
InitSourceDocument() WITH WhseActivLine DO BEGIN CASE "Source Type" OF DATABASE::"Purchase Line": BEGIN PurchHeader.GET("Source Subtype","Source No."); PurchLine.SETRANGE("Document Type","Source Subtype"); PurchLine.SETRANGE("Document No.","Source No."); IF PurchLine.FIND('-') THEN REPEAT PurchLine.VALIDATE("Qty. to Receive",0); PurchLine.VALIDATE("Qty. to Invoice",0); //-TRY THIS :START PurchLine."Variant Code" := "Variant Code"; // it is possible you have to change other fields in T39 // I didn't try out the code, but this is the place I would try to start //-TRY THIS :STOP PurchLine.MODIFY; IF PurchLine."Item Tracking No." <> 0 THEN BEGIN SourceItemTrkgLine.SETRANGE("Item Tracking No.",PurchLine."Item Tracking No."); IF SourceItemTrkgLine.FIND('-') THEN REPEAT SourceItemTrkgLine.VALIDATE("Qty. to Ship/Receive",0); SourceItemTrkgLine.VALIDATE("Qty. to Invoice",0); SourceItemTrkgLine.MODIFY; UNTIL SourceItemTrkgLine.NEXT = 0; END; UNTIL PurchLine.NEXT = 0; END;
[/quote]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thank you for your cooperation kriki, but this function is not available on Navision 4.0, so Iwould really appreciate it if someone could tell where can I do this in Navision 4.0. [-o<0
-
up0
-
up up up0
-
I checked 4.0 and I think it is here:
Still in codeunit 5760InitSourceDocumentLines(VAR WhseRcptLine : Record "Warehouse Receipt Line") WhseRcptLine2.COPY(WhseRcptLine); WITH WhseRcptLine2 DO BEGIN CASE "Source Type" OF DATABASE::"Purchase Line": BEGIN PurchLine.SETRANGE("Document Type","Source Subtype"); PurchLine.SETRANGE("Document No.","Source No."); IF PurchLine.FIND('-') THEN REPEAT SETRANGE("Source Line No.",PurchLine."Line No."); IF FIND('-') THEN IF "Source Document" = "Source Document"::"Purchase Order" THEN BEGIN ModifyLine := PurchLine."Qty. to Receive" <> "Qty. to Receive"; IF ModifyLine THEN PurchLine.VALIDATE("Qty. to Receive","Qty. to Receive") END ELSE BEGIN ModifyLine := PurchLine."Return Qty. to Ship" <> -"Qty. to Receive"; IF ModifyLine THEN PurchLine.VALIDATE("Return Qty. to Ship",-"Qty. to Receive"); END ELSE IF "Source Document" = "Source Document"::"Purchase Order" THEN BEGIN ModifyLine := PurchLine."Qty. to Receive" <> 0; IF ModifyLine THEN PurchLine.VALIDATE("Qty. to Receive",0); END ELSE BEGIN ModifyLine := PurchLine."Return Qty. to Ship" <> 0; IF ModifyLine THEN PurchLine.VALIDATE("Return Qty. to Ship",0); END; IF PurchLine."Bin Code" <> "Bin Code" THEN BEGIN PurchLine."Bin Code" := "Bin Code"; ModifyLine := TRUE; END; //-TRY THIS :START ModifyLine := TRUE; PurchLine."Variant Code" := "Variant Code"; // it is possible you have to change other fields in T39 // I didn't try out the code, but this is the place I would try to start //-TRY THIS :STOP IF ModifyLine THEN PurchLine.MODIFY; UNTIL PurchLine.NEXT = 0; END;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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