'Unshipping' a Resource

jsny355
Member Posts: 4
Good afternoon - We currently use the Resource Functionality to create a line item on our Sales Orders for Freight which we bill a customer. At times, for a variety of reasons, we wish to unship a sales order. However, the system will not allow us and errors out stating that we cannot 'unship' a resource. Similarly, we cannot 'unreceive' a resource. Is there a workaround for this or can anyone help? Perhaps Resource is not the best way to do this? We were using this and the associated programming of the resource and posting groups so that users wouldnt have to (or be able to) select a GL Account.
Thanks in advance!
Thanks in advance!
0
Comments
-
Unshipping was implemented in 5.x version and they didn't do a good job of implementing it. They basically took shortcuts. I suggest to contact your partner and ask them to change the code to allow undo shipment with resource. You would run into same issue with gl type lines.0
-
The code changes are very simple (maybe 6 lines of code) - we've done this a few times. Code below is for NAV 5 in codeunit 5815 (anything tagged with <DMS> needs to be added - there are no lines to delete):
OnRun(VAR Rec : Record "Sales Shipment Line") IF FALSE THEN BEGIN //<DMS author="MH" date="1/17/2011" issue="254" /> SETRANGE(Type,Type::Item); IF NOT FIND('-') THEN ERROR(Text006); END;//<DMS author="MH" date="1/17/2011" issue="254" /> CheckSalesShptLine(SalesShptLine : Record "Sales Shipment Line") WITH SalesShptLine DO BEGIN IF FALSE THEN //<DMS author="MH" date="1/17/2011" issue="254" /> TESTFIELD(Type,Type::Item); IF "Qty. Shipped Not Invoiced" <> Quantity THEN ERROR(Text005); TESTFIELD("Drop Shipment",FALSE); UndoPostingMgt.TestSalesShptLine(SalesShptLine); IF Type=Type::Item THEN BEGIN //<DMS author="MH" date="1/17/2011" issue="254" /> UndoPostingMgt.CollectItemLedgEntries(TempItemLedgEntry,DATABASE::"Sales Shipment Line", "Document No.","Line No.","Quantity (Base)","Item Shpt. Entry No."); UndoPostingMgt.CheckItemLedgEntries(TempItemLedgEntry,"Line No."); //<DMS author="M.Hamblin" date="1/17/2011" issue="254" > END ELSE BEGIN TempItemLedgEntry.RESET; TempItemLedgEntry.DELETEALL; END;//if //</DMS> END; PostItemJnlLine(SalesShptLine : Record "Sales Shipment Line";VAR DocLineNo : Integer) : Integer WITH SalesShptLine DO BEGIN SalesShptLine2.SETRANGE("Document No.","Document No."); SalesShptLine2."Document No." := "Document No."; SalesShptLine2."Line No." := "Line No."; SalesShptLine2.FIND('='); IF SalesShptLine2.FIND('>') THEN BEGIN LineSpacing := (SalesShptLine2."Line No." - "Line No.") DIV 2; IF LineSpacing = 0 THEN ERROR(Text002); END ELSE LineSpacing := 10000; DocLineNo := "Line No." + LineSpacing; //<DMS author="M.Hamblin" date="1/17/2011" issue="254" > IF Type<>Type::Item THEN EXIT(0); //</DMS> ...
Of course, make sure you test to ensure these changes work in your database (and that I copied and pasted everything properly).
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
- 322 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