Microsoft Dynamics GP Table Reference: Products Added

Microsoft Dynamics GP Table ReferenceOn Thursday last week, I introduced the new Microsoft Dynamics GP Table Reference I was in the process of creating and said I’d be adding new products soon.

Well, I got it done a bit quicker than I thought, and now have all of the Microsoft Dynamics GP modules loaded.

I will be adding ISV products through time, but if there are any in particular which you want to me to progress sooner, then please drop me a note using the contact form.

Microsoft Dynamics GP Table Reference

Microsoft Dynamics GP Table ReferenceThere are a fair number of really good resources out there on Microsoft Dynamics GP, but, unfortunately, some of them disappear through time.

One of the casualties was the GP Table Reference, which closed down a while ago. I’m not sure who was behind the site, but it has been missed.

To that end, I have started building a new site to live alongside this one; the Microsoft Dynamics GP Table Reference. The site is a work in progress, and will likely always be.

At present it has the main Microsoft Dynamics GP products tables along with the tables for Fixed Assets (product 309), Purchase Order Enhancements (product 2277) and Revenue Expense Deferrals (product 1045).

I will be adding products soon and will continue adding them until I have all of the first party products and will then look to start adding some of the more popular/common ISV ones.

I’ll also be adding some further explanations and to the fields, such as the one already added to the LOCNCODE field in Purchase Order Line (POP10110).

I hope people find the site useful; if you do use it and spot any issues, or want anything adding, please get in touch and let me know.

Script To Copy Segments To All Companies

Microsoft Dynamics GPFollowing the last post I did, on copying segments to a new company, I did some thinking and realised that with a little more work on the script I could make it even more useful when setting up clients with multiple companies and the same chart of account structure.

I have added a cursor to the script which selects all company databases from the DYNAMICS System Database (change the highlighted DYNAMICS if you’re using a named system database) and then loops though them doing the insert from the SourceDatabase.

As before, the script checks to make sure the Segments don’t already exist in the destination before doing the insert.

DECLARE @SourceCompany AS VARCHAR(5)
DECLARE @DestinationCompany AS VARCHAR(5)
DECLARE @SQLStatement AS VARCHAR(2000)

SET @SourceCompany = 'TWO'

DECLARE
	cursor_InterID Cursor 
FOR 
	SELECT
		INTERID
	FROM
		DYNAMICS..SY01500
	INNER JOIN
		master..sysdatabases
	ON
		name = INTERID
	WHERE
		INTERID <> @SourceCompany
	
	Open cursor_InterID

	FETCH NEXT FROM
		cursor_InterID
	INTO
		@DestinationCompany
	While (@@FETCH_STATUS <> -1)
		BEGIN
		IF (@@FETCH_STATUS <> -2)
			SET @SQLStatement = 'INSERT INTO ' + @DestinationCompany + '..GL40200
				(SGMTNUMB
				,SGMNTID
				,DSCRIPTN
				,SEGCOUNT
				,NOTEINDX)
				
				(SELECT
					SGMTNUMB
					,SGMNTID
					,Left(DSCRIPTN, 30)
					,0
					,0
				FROM
					' + @SourceCompany + '..GL40200 AS SD
				WHERE (SELECT COUNT(GL.SGMNTID) FROM ' + @DestinationCompany + '..GL40200 GL
					WHERE GL.SGMTNUMB = SD.SGMTNUMB AND GL.SGMNTID = SD.SGMNTID) = 0)'

			EXEC (@SQLStatement)
			FETCH NEXT FROM
				cursor_InterID
			INTO
				@DestinationCompany
		END
	CLOSE cursor_InterID
DEALLOCATE cursor_InterID

If you run this script, please be careful and ensure you have a good backup before running the script (as I don’t supply a warranty with any script I post here; that said I am happy to talk to people if they have questions or would like the script extending).

Script To Copy Segments To A New Company

Microsoft Dynamics GPI have been doing some work with a client recently where we were creating a number of new companies which were to share the same chart of accounts (with only the first segment representing the company being different).

So we planned to use Integration Manager to to integrate a file containing the new chart of accounts. However, before we could load the accounts themselves we needed to get the Segments loaded.

Tis could be done by creating a SmartList in SmartList Designer to get the Segment Number, Segment ID and Segment Description and then use File Import to load the segments into the new company; or I could knock together a quick SQL script to do the job.

Obviously, as I am writing this post, I opted to go the route of writing an SQL Script. The highlighted pieces at the top are the Source and Destination Company databases; change these to the relevant databases.

The script also checks to make sure the Segments don’t already exist in the destination before doing the insert.

DECLARE @SourceCompany AS VARCHAR(5)
DECLARE @DestinationCompany AS VARCHAR(5)
DECLARE @SQLStatement AS VARCHAR(2000)

SET @SourceCompany = 'TWO'
SET @DestinationCompany = 'TWOA'

SET @SQLStatement = 'INSERT INTO ' + @DestinationCompany + '..GL40200
	(SGMTNUMB
	,SGMNTID
	,DSCRIPTN
	,SEGCOUNT
	,NOTEINDX)
	
	(SELECT
		SGMTNUMB
		,SGMNTID
		,Left(DSCRIPTN, 30)
		,0
		,0
	FROM
		' + @SourceCompany + '..GL40200 AS SM
	WHERE (SELECT COUNT(GL.SGMNTID) FROM ' + @DestinationCompany + '..GL40200 GL
		WHERE GL.SGMTNUMB = SM.SGMTNUMB AND GL.SGMNTID = SM.SGMNTID) = 0)'

EXEC (@SQLStatement)
GO

If you run this script, please be careful and ensure you have a good backup before running the script (as I don’t supply a warranty with any script I post here; that said I am happy to talk to people if they have questions or would like the script extending).

Management Reporter Is Unable To Connect To The Company

Microsoft Dynamics GPA client was recently having problems with the Microsoft Dynamics GP Datamart in Management Reporter 2012, so I removed the DDM and installed the Legacy GP Connector. I tested it on the server and all worked okay so I asked the user to try.

Unfortunately, it didn’t just work and they got the below error:

Management Reporter - Unable to connect to the Management Reporter – Unable to connect to the ‘{company}’. The connection to the Microsoft Dynamics GP database failed. Contact your system administrator.

Continue reading “Management Reporter Is Unable To Connect To The Company”