Update Creditor Addresses From CSV To Work Around An Integration Manager Bug

I was doing some work for a client recently where we were loading lists of new creditors into Microsoft Dynamics GP from CSV files via Integration Manager. There is, however, a bug in IM 10 where it adds extra zeros to the phone and fax number fields of both creditors and debtors. These extra characters are, rather bizarrely, not always at the end but can be interspersed in the phone number.

The easiest work around was to put together a SQL script for loading the phone and fax numbers from CSV file which I did while on site which updated only a single address on the PM Creditor Master (PM00200) and PM Address Master (PM00300) tables.

While the script I wrote on site satisfied the clients immediate import needs, the script was very basic. To make things easier in future I have created a new script which can update multiple addresses as the same time while making sure both PM00200 and PM00300 are correctly in sync;


CREATE TABLE #NewCreditorAddressMaster
   (
   
VENDORID VARCHAR(100)
   ,ADRSCODE VARCHAR(100)
   ,PHNUMBR1 VARCHAR(100)
   ,PHNUMBR2 VARCHAR(100)
   ,PHONE3 VARCHAR(100)
   ,FAXNUMBR VARCHAR(100)
   )
GO

BULK INSERT
   #NewCreditorAddressMaster
FROM
   'c:\temp\Creditors.csv'
WITH
   (
   
FIELDTERMINATOR = ','
   ,ROWTERMINATOR = '\n'
   )

GO

UPDATE
   ['PM Address Master']
SET
   PHNUMBR1 = Left(#NewCreditorAddressMaster.PHNUMBR1, 14)
   ,PHNUMBR2 = Left(#NewCreditorAddressMaster.PHNUMBR2, 14)
   ,PHONE3 = Left(#NewCreditorAddressMaster.PHONE3, 14)
   ,FAXNUMBR = Left(#NewCreditorAddressMaster.FAXNUMBR, 14)
FROM
   PM00300 AS ['PM Address Master']
INNER JOIN
   #NewCreditorAddressMaster
      ON #NewCreditorAddressMaster.VENDORID = ['PM Address Master'].VENDORID
         AND #NewCreditorAddressMaster.ADRSCODE = ['PM Address Master'].ADRSCODE

UPDATE
   ['PM Creditor Master']
SET
   PHNUMBR1 = LEFT(['PM Address Master'].PHNUMBR1, 14)
   ,PHNUMBR2 = LEFT(['PM Address Master'].PHNUMBR2, 14)
   ,PHONE3 = LEFT(['PM Address Master'].PHONE3, 14)
   ,FAXNUMBR = LEFT(['PM Address Master'].FAXNUMBR, 14)
FROM
   PM00200 AS ['PM Creditor Master']
INNER JOIN
   PM00300 AS ['PM Address Master']
      ON ['PM Address Master'].VENDORID = ['PM Creditor Master'].VENDORID
         AND ['PM Address Master'].ADRSCODE = ['PM Creditor Master'].VADDCDPR

DROP TABLE #NewCreditorAddressMaster

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, Integration Manager, Microsoft and tagged , , , , , , , , , , , , . Bookmark the permalink.

2 comments on “Update Creditor Addresses From CSV To Work Around An Integration Manager Bug

  1. Pingback: Interesting Findings & Knowledge Sharing » Update Creditor Addresses From CSV To Work Around An Integration Manager Bug

  2. Pingback: Update Debtor Addresses From CSV To Work Around An Integration Manager Bug | azurecurve

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>