SQL Scripts for Microsoft Dynamics GP: Update Vendor Phone and Fax Numbers From CSV

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script will take a CSV file and update the three phone numbers and fax numbers on the vendor address supplied.

/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
CREATE TABLE #PM00200_IMPORT ( VENDORID VARCHAR(100) ,ADRSCODE VARCHAR(100) ,PHNUMBR1 VARCHAR(100) ,PHNUMBR2 VARCHAR(100) ,PHONE3 VARCHAR(100) ,FAXNUMBR VARCHAR(100) ) GO BULK INSERT #PM00200_IMPORT FROM 'C:\Temp\Supplier Phone and Fax.csv' WITH ( FIELDTERMINATOR = ',' ,ROWTERMINATOR = '\n' ,FIRSTROW = 2 ) GO select * from #PM00200_IMPORT -- VENDOR MASTER UPDATE PM SET PM.PHNUMBR1 = ISNULL(PM_I.PHNUMBR1,'') ,PM.PHNUMBR2 = ISNULL(PM_I.PHNUMBR2,'') ,PM.PHONE3 = ISNULL(PM_I.PHONE3,'') ,PM.FAXNUMBR = ISNULL(PM_I.FAXNUMBR,'') FROM PM00200 PM INNER JOIN #PM00200_IMPORT As PM_I ON UPPER(PM_I.ADRSCODE) = PM.VENDORID AND PM_I.ADRSCODE = "MAIN" GO -- VENDOR ADDRESS MASTER UPDATE PM SET PM.PHNUMBR1 = ISNULL(PM_I.PHNUMBR1,'') ,PM.PHNUMBR2 = ISNULL(PM_I.PHNUMBR2,'') ,PM.PHONE3 = ISNULL(PM_I.PHONE3,'') ,PM.FAXNUMBR = ISNULL(PM_I.FAXNUMBR,'') FROM PM00300 PM INNER JOIN #PM00200_IMPORT As PM_I ON PM_I.VENDORID = PM.VENDORID AND PM.ADRSCODE = UPPER(PM_I.ADRSCODE) GO DROP TABLE #PM00200_IMPORT GO

In Microsoft Dynamics 365 Business Central (Administration), how do I… Switch Between Companies

Microsoft Dynamics 365 Business CentralThis post is part of the In Microsoft Dynamics 365 Business Central (Administration), how do I… series and of the wider In Microsoft Dynamics 365 Business Central, how do I… series which I am posting as I familiarise myself with Microsoft Dynamics 365 Business Central.

If you’ve been following this series of posts where I familiarise myself with Dynamics BC, then the title of this post will look familiar; that’s because I did a post on the 6th September with the same name. I am not repeating that article, but posting a new version as the functionality available in Dynamics BC has changed since that article was published.

I originally started this series using Release 2022 Wave 1, but my environment has not been updated to Release 2022 Wave 2 which saw new functionality introduced which allows for switching between companies across environments and also within the same environment.

The new method of switching no longer requires you to go to the My Settings page; instead the entry on the app bar which used to state the name of the environment now shows the environment name in smaller letters below a title. When you click on it, a sidebar opens showing the available environments and companies therein:

New Available Companies sidebar showing environments and companies

Continue reading “In Microsoft Dynamics 365 Business Central (Administration), how do I… Switch Between Companies”