Update Year on Budgets in Fabrikam Sample Company

Microsoft Dynamics GPI’ve written a few scripts to update data in the Fabrikam sample company (I will be posting a series index to link them all together in the near future).

The sample company ships with a few budgets preloaded, but they are not named very well. For example, the budget for 2027 (the year in which Fabrikam is operating) is named BUDGET 4 and the budget for 2025 is named BUDGET 2005.

/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (http://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales (CC BY-NC-SA 2.0 UK).
*/

-- UPDATE Budget Master (GL00200)
UPDATE
	GL00200
SET
	BUDGETID = 'MASTER 2024'
	,BUDCOMNT = 'MASTER 2024'
WHERE
	BUDGETID = 'BUDGET1'
GO
UPDATE
	GL00200
SET
	BUDGETID = 'FORECAST 2024'
	,BUDCOMNT = 'FORECAST 2024'
WHERE
	BUDGETID = 'BUDGET2'
GO
UPDATE
	GL00200
SET
	BUDGETID = 'REFORECAST 2024'
	,BUDCOMNT = 'REFORECAST 2024'
WHERE
	BUDGETID = 'BUDGET3'
GO
UPDATE
	GL00200
SET
	BUDGETID = 'MASTER 2025'
	,BUDCOMNT = 'MASTER 2025'
WHERE
	BUDGETID = 'BUDGET 2005'
GO
UPDATE
	GL00200
SET
	BUDGETID = 'MASTER 2026'
	,BUDCOMNT = 'MASTER 2026'
WHERE
	BUDGETID = 'BUDGET 2006'
GO
UPDATE
	GL00200
SET
	BUDGETID = 'FORECAST 2027'
	,BUDCOMNT = 'FORECAST 2027'
WHERE
	BUDGETID = 'BUDGET 4'
GO
UPDATE
	GL00200
SET
	BUDGETID = 'MASTER 2028'
	,BUDCOMNT = 'MASTER 2028'
WHERE
	BUDGETID = 'BUDGET 2008'
GO

-- UPDATE Budget Summary Master (GL00201)
UPDATE
	GL00201
SET
	BUDGETID = 'MASTER 2024'
WHERE
	BUDGETID = 'BUDGET1'
GO
UPDATE
	GL00201
SET
	BUDGETID = 'FORECAST 2024'
WHERE
	BUDGETID = 'BUDGET2'
GO
UPDATE
	GL00201
SET
	BUDGETID = 'REFORECAST 2024'
WHERE
	BUDGETID = 'BUDGET3'
GO
UPDATE
	GL00201
SET
	BUDGETID = 'MASTER 2025'
WHERE
	BUDGETID = 'BUDGET 2005'
GO
UPDATE
	GL00201
SET
	BUDGETID = 'MASTER 2026'
WHERE
	BUDGETID = 'BUDGET 2006'
GO
UPDATE
	GL00201
SET
	BUDGETID = 'FORECAST 2027'
WHERE
	BUDGETID = 'BUDGET 4'
GO
UPDATE
	GL00201
SET
	BUDGETID = 'MASTER 2028'
WHERE
	BUDGETID = 'BUDGET 2008'
GO

This script has been created to be run only against the Fabrikam sample company database.

What should we write about next?

Your Name (required) -
Your Email (required) -

Leave a Reply

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