SQL Scripts for Microsoft Dynamics GP: Update Items Default Purchasing Unit of Measure 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 updates the default purchasing unit of measure on items from a CSV file. It will validate the item during the import and if there are any errors these will be presented to the user and the data will only be updated when there are no errors.

/*
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 TEMP ERROR TABLE */ CREATE TABLE #Errors ( Error VARCHAR(1000) ,ROW_ID INT IDENTITY ) GO /* CREATE TEMP TABLE FOR DATA */ CREATE TABLE #IV00101_IMPORT ( ITEMNMBR VARCHAR(30) ,PRCHSUOM VARCHAR(10) ) GO /* BULK INSERT */ BULK INSERT #IV00101_IMPORT FROM 'c:\temp\ItemPurchasing.txt' WITH (FIELDTERMINATOR = ',' ,ROWTERMINATOR = '\n' ,FIRSTROW = 2 ) GO /* VALIDATE DATA */ INSERT INTO #Errors (Error) --VALUES ( SELECT 'Item record does not exist: ' + CAST(IMPORT.ITEMNMBR AS VARCHAR(100)) FROM #IV00101_IMPORT AS IMPORT LEFT JOIN IV00101 AS ['Item Master'] --Item Master (IV00101) ON ['Item Master'].ITEMNMBR = IMPORT.ITEMNMBR WHERE ['Item Master'].ITEMNMBR IS NULL ) GO /* UPDATE EXISTING DATA IF NO ERRORS */ IF (SELECT COUNT(*) FROM #Errors) = 0 -- UPDATE if Email Details present UPDATE ['Item Master'] SET PRCHSUOM = IMPORT.PRCHSUOM FROM IV00101 AS ['Item Master'] --Item Master (IV00101) INNER JOIN #IV00101_IMPORT AS IMPORT ON IMPORT.ITEMNMBR = ['Item Master'].ITEMNMBR GO /* OUTPUT ERRORS */ IF (SELECT COUNT(*) FROM #Errors) > 0 SELECT Error FROM #Errors ORDER BY ROW_ID GO /* DROP TEMP TABLES */ DROP TABLE #IV00101_IMPORT GO DROP TABLE #Errors GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP: Update Items Default Purchasing Unit of Measure from CSV Series Index

SQL Scripts for Microsoft Dynamics GP: Update Items Default Purchasing Unit of Measure from CSV

Change Alignment of Windows 11 Taskbar

WindowsEver since Windows 95 Windows has had a taskbar at the bottom of the screen (by default although you can change the placement. The icons on the taskbar are aligned to the left on all versions of Windows until Windows 11 where the icons are in the middle of the taskbar.

While I do try to take some updates to Windows and other apps, this is one too far. My main problem is that because it is centred, when you open more apps, the icons currently open all move to the left as the new ones open at the end. This makes for a constantly moving target for the icons; when they’re left aligned, the icons never move so you can use a little muscle memory to quickly select the correct one.

Fortunately, it is quite straightforward to change the Windows 11 taskbar to have the icons left aligned again like previous versions of Windows. Do this by launching the Taskbar personalisation page from the Control Panel, or quickly by using the ms-settings shortcut for it: ms-settings:taskbar

Part way down the page is a Taskbar Behaviors section; to change the alignment of the taskbar, change the Taskbar alignment option:

Taskbar personalisation settings page

Once you change the setting, your taskbar will realign to match.