SQL Script to Insert Vendors

Microsoft Dynamics GPWhile writing a Rockton Software’s SmartFill product recently, I wanted to do a test on a large dataset. The testing of SmartFill I had done to that point had been on vendors, so I deviced to continue in that vein.

I produced the script below which inserts records into the PM Vendor Master File (PM00200) and PM Address MSTR (PM00300) tables bgy copying an existing vendor, but assigning a unique Vendor ID to each new record. For ease of running, I creaed the script as a stored procedure wic accepts the number of records to create, the vendor to be copied and the new name of the vendor which will be created concatenated with an increasing integer.

-- drop stored proc if it exists
IF OBJECT_ID (N'usp_AZRCRV_CreateTestVendors', N'P') IS NOT NULL
    DROP PROCEDURE usp_AZRCRV_CreateTestVendors
GO

-- create stored proc
CREATE PROCEDURE usp_AZRCRV_CreateTestVendors
	@MaxLoop INT = 5
	,@VendorID VARCHAR(15) = 'BEAUMONT0001'
	,@VendorIDPrefix VARCHAR(8) = 'VEND'
AS
	/*
	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).
	*/
	DECLARE @Loop INT = 1

	WHILE (@Loop <= @MaxLoop)
		BEGIN
			-- Insert into PM Vendor Master File (PM00200)
			INSERT INTO PM00200
				(
					VENDORID,VENDNAME,VNDCHKNM,VENDSHNM,VADDCDPR,VADCDPAD,VADCDSFR,VADCDTRO,VNDCLSID,VNDCNTCT,ADDRESS1,ADDRESS2,ADDRESS3,CITY,STATE,ZIPCODE,COUNTRY,PHNUMBR1,PHNUMBR2,PHONE3,FAXNUMBR,UPSZONE,SHIPMTHD,TAXSCHID,ACNMVNDR,TXIDNMBR,VENDSTTS,CURNCYID,TXRGNNUM,PARVENID,TRDDISCT,TEN99TYPE,TEN99BOXNUMBER,MINORDER,PYMTRMID,MINPYTYP,MINPYPCT,MINPYDLR,MXIAFVND,MAXINDLR,COMMENT1,COMMENT2,USERDEF1,USERDEF2,CRLMTDLR,PYMNTPRI,KPCALHST,KGLDSTHS,KPERHIST,KPTRXHST,HOLD,PTCSHACF,CREDTLMT,WRITEOFF,MXWOFAMT,SBPPSDED,PPSTAXRT,DXVARNUM,CRTCOMDT,CRTEXPDT,RTOBUTKN,XPDTOBLG,PRSPAYEE,PMAPINDX,PMCSHIDX,PMDAVIDX,PMDTKIDX,PMFINIDX,PMMSCHIX,PMFRTIDX,PMTAXIDX,PMWRTIDX,PMPRCHIX,PMRTNGIX,PMTDSCIX,ACPURIDX,PURPVIDX,NOTEINDX,CHEKBKID,MODIFDT,CREATDDT,RATETPID,Revalue_Vendor,Post_Results_To,FREEONBOARD,GOVCRPID,GOVINDID,DISGRPER,DUEGRPER,DOCFMTID,TaxInvRecvd,USERLANG,WithholdingType,WithholdingFormType,WithholdingEntityType,TaxFileNumMode,BRTHDATE,LaborPmtType,CCode,DECLID,CBVAT,Workflow_Approval_Status,Workflow_Priority,Workflow_Status,VADCD1099,ONEPAYPERVENDINV
				)
			-- VALUES
				(SELECT
					
					@VendorIDPrefix + CAST(@Loop AS VARCHAR(7))
					,VENDNAME,VNDCHKNM,VENDSHNM,VADDCDPR,VADCDPAD,VADCDSFR,VADCDTRO,VNDCLSID,VNDCNTCT,ADDRESS1,ADDRESS2,ADDRESS3,CITY,STATE,ZIPCODE,COUNTRY,PHNUMBR1,PHNUMBR2,PHONE3,FAXNUMBR,UPSZONE,SHIPMTHD,TAXSCHID,ACNMVNDR,TXIDNMBR,VENDSTTS,CURNCYID,TXRGNNUM,PARVENID,TRDDISCT,TEN99TYPE,TEN99BOXNUMBER,MINORDER,PYMTRMID,MINPYTYP,MINPYPCT,MINPYDLR,MXIAFVND,MAXINDLR,COMMENT1,COMMENT2,USERDEF1,USERDEF2,CRLMTDLR,PYMNTPRI,KPCALHST,KGLDSTHS,KPERHIST,KPTRXHST,HOLD,PTCSHACF,CREDTLMT,WRITEOFF,MXWOFAMT,SBPPSDED,PPSTAXRT,DXVARNUM,CRTCOMDT,CRTEXPDT,RTOBUTKN,XPDTOBLG,PRSPAYEE,PMAPINDX,PMCSHIDX,PMDAVIDX,PMDTKIDX,PMFINIDX,PMMSCHIX,PMFRTIDX,PMTAXIDX,PMWRTIDX,PMPRCHIX,PMRTNGIX,PMTDSCIX,ACPURIDX,PURPVIDX,NOTEINDX,CHEKBKID,MODIFDT,CREATDDT,RATETPID,Revalue_Vendor,Post_Results_To,FREEONBOARD,GOVCRPID,GOVINDID,DISGRPER,DUEGRPER,DOCFMTID,TaxInvRecvd,USERLANG,WithholdingType,WithholdingFormType,WithholdingEntityType,TaxFileNumMode,BRTHDATE,LaborPmtType,CCode,DECLID,CBVAT,Workflow_Approval_Status,Workflow_Priority,Workflow_Status,VADCD1099,ONEPAYPERVENDINV
				FROM
					PM00200
				WHERE
					VENDORID = @VendorID)

			-- Insert into PM Address MSTR (PM00300)
			INSERT INTO PM00300
				(
					VENDORID,ADRSCODE,VNDCNTCT,ADDRESS1,ADDRESS2,ADDRESS3,CITY,STATE,ZIPCODE,COUNTRY,UPSZONE,PHNUMBR1,PHNUMBR2,PHONE3,FAXNUMBR,SHIPMTHD,TAXSCHID,EmailPOs,POEmailRecipient,EmailPOFormat,FaxPOs,POFaxNumber,FaxPOFormat,CCode,DECLID
				)
			-- VALUES
				(SELECT
					
					@VendorIDPrefix + CAST(@Loop AS VARCHAR(7))
					,ADRSCODE,VNDCNTCT,ADDRESS1,ADDRESS2,ADDRESS3,CITY,STATE,ZIPCODE,COUNTRY,UPSZONE,PHNUMBR1,PHNUMBR2,PHONE3,FAXNUMBR,SHIPMTHD,TAXSCHID,EmailPOs,POEmailRecipient,EmailPOFormat,FaxPOs,POFaxNumber,FaxPOFormat,CCode,DECLID
				FROM
					PM00300
				WHERE
					VENDORID = @VendorID)
			SET @Loop = @Loop + 1
		END
	GO
GO

-- grant execute permission on stored proc to DYNGRP
GRANT EXECUTE ON usp_AZRCRV_CreateTestVendors TO DYNGRP
GO

-- execute stored proc
EXEC usp_AZRCRV_CreateTestVendors 20, 'ADVANCED0001', 'VENDOR'
GO

This script was created for, tested with and only run against the Fabrikam sample database.

Implementing Enhanced Notes: What is Enhanced Notes?

GP Elementz Enhanced NotesThis post is part of a series on Implementing Enhanced Notes from ISC Software Solutions.

Enhanced Notes is one of the GP Elementz available from ISC Software Solutions.

The Enhanced Notes module is a Dexterity customisation which is installed on every Microsoft Dynamics client which replaces the standard notes window in all areas of Dynamics GP.

Instead of a single notes page, Enhanced Notes allows discrete notes to be created:

Continue reading “Implementing Enhanced Notes: What is Enhanced Notes?”

Hands On with Microsoft Dynamics GP 2018 R2: Add Sample Company

Microsoft Dynamics GPMicrosoft Dynamics GP 2018 R2 was released on the 2nd October. In this series of posts, I’ll be going hands on and installing the majority of the components; some of them, such as Analysis Cubes for Excel, which are little used, I won’t be covering.

The series index will automatically update as posts go-live in this series.

In the last post, I deployed the system database; I’m continuing this post from the Additional Tasks step.

Ensure the drop-down list shows Add sample company data and click Process:

Additional Tasks

Continue reading “Hands On with Microsoft Dynamics GP 2018 R2: Add Sample Company”

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.

Continue reading “Update Year on Budgets in Fabrikam Sample Company”

Hands On With MDGP 2018 RTM: Deploy Sample Company

Microsoft Dynamics GPMicrosoft Dynamics GP 2018 RTM has now been released. In this series of posts, I will be stepping through the installation of Microsoft Dynamics GP and additional products and then will move on to taking a look at the new functionality which has been introduced.

The series index for this series of posts is here and will automatically update as posts go live.

With the system database deployed, the next step is to deploy the Fabrikam, Inc. sample company.

To do this, launch GP Utilities and log in using the sa account:

Welcome to Microsoft Dynamics GP Utilities

Continue reading “Hands On With MDGP 2018 RTM: Deploy Sample Company”

Perfect Image ERP Practice Ready for #FabrikamDay

Microsoft Dynamics GPI imagine all Microsoft Dynamics GP partners are aware that Fabrikam Day is soon to be upon us (6 sleeps!). Amber Bell gives a good writeup of the origin of Fabrikam Day. The first sample company I remember working with is Fabrikam; I’m apparently a little too young to remember The World Online (which lives on in the default Fabrikam database name of TWO).

In advance of Fabrikam Day we got a couple of photos taken. The first is just me:

Ian Grieve, ERP Practice Manager at perfect Image and Microsoft Most Valuable ProfessionalIan Grieve, ERP Practice Manager at Perfect Image and Microsoft Most Valuable Professional

And also roped in the ERP Practice for a photo too: Continue reading “Perfect Image ERP Practice Ready for #FabrikamDay”

Hands On With Microsoft Dynamics GP 2016 R1: Deploy Sample Company

Microsoft Dynamics GPWith the system database deployed it is now time to deploy the sample company. This is done by launching GP Utilities.

Enter the user and password and click OK to log in:

Welcome to Microsoft Dynamics GP Utilities

Continue reading “Hands On With Microsoft Dynamics GP 2016 R1: Deploy Sample Company”

Hands On With Microsoft Dynamics GP 2015 R2: Deploy The Sample Company

Microsoft Dynamics GPMicrosoft Dynamics GP 2015 R2 was released at the end of May. As I mentioned at the time, I was away from home for work and rather busy otherwise so this series of posts has been somewhat delayed.

However, I am now getting my hands on GP 2015 R2 and thought I would do my usual set of posts on the installation of the various components and also the usage of the new functionality. This is going to be quite a long series of posts, so keep checking back regularly.

The third post, covers the deployment of the Fabrikam, Inc. sample company. Launch GP Utilities from the Home screen by right clicking and doing Run as Administrator. Log in using the sa or DYNSA account:

Welcome to Microsoft Dynamics GP Utilities

Continue reading “Hands On With Microsoft Dynamics GP 2015 R2: Deploy The Sample Company”

Fixing Base Period On Management Reporter Sample Company Reports

Microsoft Dynamics GPI did a couple of posts a while ago on fixing the sample company reports (the first post fixed the Row and Column Definitions and the second the Reporting Tree Definitions), but there has been another issue with them that has been bugging me for a while.

The reports are configured to run for periods around the current system date, which means dates in 2013. But the Fabrikam sample company is in 2017 so the reports return no data. With Management Reporter storing its reports and configuration information on a SQL Server database, it is possible to tweak the reports to run for 2017.

I checked each of the reports to see how what Base period they were using and then worked out what I needed to update to set the reports to run for similar periods in 2017.

Continue reading “Fixing Base Period On Management Reporter Sample Company Reports”

Can’t Delete Company In Management Reporter

Microsoft Dynamics GPWe recently took on a new client who already had Microsoft Dynamics GP and had been migrated to Management Reporter before we took them on for support.

I did a little exercise of checking configuration and tidied up where needed. One item I found was two companies in Management Reporter which were not needed; these were the FW and FWC companies.

When I selected the first of them and hit delete, I received the following message:

Management Reporter 2012 - This company is referenced by an existing report definition or reporting tree definition. Remove these associations before deleting the company.Management Reporter 2012 – This company is referenced by an existing report definition or reporting tree definition. Remove these associations before deleting the company.

Continue reading “Can’t Delete Company In Management Reporter”