Recent Lack Of Posts Down To New Project

Microsoft Dynamics GPIf you’re a regular visitor then you’ll have noticed a distinct lack of posts in August. The reason is that I have been working on a side project which should come to fruition in the middle of September. I’ll be trying to restore normal service before then, but if not it will be back to normal posting from mid-September.

The side project is Microsoft Dynamics GP related and I hope it will be of use to the community; details will be supplied nearer to the release date.

SmartList Builder Will Be Disabled Until It Is Initialized By The System Administrator

Microsoft Dynamics GPI have been involved in several upgrade projects with clients recently where we have been upgrading them from Microsoft Dynamics GP 2010 through to Microsoft Dynamics GP 2013. Since this version was launched, SmartList Builder has been pushed back out to eOne, the original ISV.

So, after doing the normal upgrade process, we have then installed the latest version of SmartList Builder from the eOne website. However, this has not been a smooth process.

One of the clients started receiving the following error message whenever a user tried to access SmartList:

SmartList Builder Will Be Disabled Until It Is Initialized By The System Administrator

Continue reading “SmartList Builder Will Be Disabled Until It Is Initialized By The System Administrator”

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).