Update Sales Transactions Distributions From Item

This is a script I’ve had a few months now and, like the one I posted yesterday, thought it might be useful to others.

This script was created for a client who changed some of their account codes on some Item Classes and had rolled them down to the Items themselves but there were many Sales Transactions already on the system which had the old code on and needed to be updated to the new one.

A relatively simple SQL script later and I had a method which would update all Quotes and Orders at a status of Work in Sales Order Processing with the new codes from the Item where the Item Class was within a required range;


UPDATE
   ['Sales Transactions Amounts Work']
SET
   INVINDX = ['Item Master'].IVIVINDX -- Inventory
   ,CSLSINDX = ['Item Master'].IVCOGSIX -- Cost of Goods Sold
   ,SLSINDX = ['Item Master'].IVSLSIDX -- Sales
FROM
   SOP10200 AS ['Sales Transactions Amounts Work']
INNER JOIN
   IV00101 AS ['Item Master']
      ON ['Item Master'].ITEMNMBR = ['Sales Transactions Amounts Work'].ITEMNMBR
WHERE
   ['Sales Transactions Amounts Work'].SOPTYPE IN (1, 2)
AND
   ['Item Master'].ITMCLSCD IN ('MASONRY', 'ROOFING', 'WINDOWS')

If Invoices, Returns or Fulfillment Orders also need to be updated then another script which updates Sales Transaction Distributions Work (SOP10102) would be needed in addition to the above.

If you use this script then, as always when running a script, please make sure you have a good backup of your company database (I define a good backup as one you have restored to ensure it backed up correctly) and know what you are doing in Management Studio with SQL Statements.

Ian Grieve

About Ian Grieve

Ian is a Microsoft Dynamics GP certified consultant specialising in the delivery of Microsoft Dynamics GP projects and currently working for Perfect Image Ltd., a Microsoft Partner and VAR in the North East of England. Ian has worked with Microsoft Dynamics GP since 2003 and, over the nine years since, has dealt with all aspects of the product life-cycle from presales, to implementation, to technical and functional training, to post go-live support and subsequent upgrades and process reviews. In his spare time, Ian runs the azurecurve | Ramblings of a Dynamics GP Consultant blog dedicated to Microsoft Dynamics GP and related products.
This entry was posted in Dynamics, GP, Microsoft and tagged , , , , , , , , . Bookmark the permalink.

2 comments on “Update Sales Transactions Distributions From Item

  1. Pingback: Interesting Findings & Knowledge Sharing » Update Sales Transactions Distributions From Item

  2. Pingback: Update Sales Transactions Distributions From Item | azurecurve - DynamicAccounting.net - GP Technical Blogs - Microsoft Dynamics Community

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>