Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

GP Utilities Fails to create new company

Posted on by Microsoft Employee

I am trying to create a new company in GP for Testing. I have been through this process many times before but I have one particular instance that is giving me trouble when attempting to create the database.

During the Process I get this message during the "Load Stored Procedures" section.

The following SQL statement produced an error:

CREATE PROCEDURE dbo.wfOutOfOfficeDelegationCleanup as begin set NOCOUNT ON declare @domain char(64), @alias char(20), @DomainUserName char(255) declare @length smallint, @position smallint, @UsersListGuid char(37), @ActualUsersListGuid char(37) declare Delegation_Users cursor local fast_forward for select DomainUserName, UsersListGuid from WF40500 open Delegation_Users fetch next from Delegation_Users into @DomainUserName, @UsersListGuid while @@FETCH_STATUS=0 begin select @length=LEN(@DomainUserName) select @position=charindex('\',@DomainUserName) select @domain=SUBSTRING(@DomainUserName,1,(@position-1)) select @alias=SUBSTRING(@DomainUserName,(@position+1),(@length-@position)) select @ActualUsersListGuid = rtrim(upper(isnull((select DYNAMICS.dbo.GetObjectGuidByDomainAlias(rtrim(@domain),rtrim(@alias),1,0)),''))) if rtrim(upper(@UsersListGuid))<>rtrim(@ActualUsersListGuid) begin delete from WF40510 where UsersListGuid=@UsersListGuid delete from WF40500 where UsersListGuid=@UsersListGuid end fetch next from Delegation_Users into @DomainUserName, @UsersListGuid end close Delegation_Users deallocate Delegation_Users declare Delegation_Lines cursor local fast_forward for select DomainUserName from WF40510 open Delegation_Lines fetch next from Delegation_Lines into @DomainUserName while @@FETCH_STATUS=0 begin select @length=LEN(@DomainUserName) select @position=charindex('\',@DomainUserName) select @domain=SUBSTRING(@DomainUserName,1,(@position-1)) select @alias=SUBSTRING(@DomainUserName,(@position+1),(@length-@position)) if DYNAMICS.dbo.IsValidADUser(rtrim(@domain),rtrim(@alias),1,0)=0 begin delete from WF40510 where DomainUserName=@DomainUserName end fetch next from Delegation_Lines into @DomainUserName end close Delegation_Lines deallocate Delegation_Lines delete from WF40500 where rtrim(upper(UsersListGuid)) not in (select rtrim(upper(UsersListGuid)) from WF40510) declare @UserDelegationDates TABLE(ENDDATE datetime, UsersListGuid char(37)) insert into @UserDelegationDates select MAX(ENDDATE) as ENDDATE,UsersListGuid from WF40510 group by UsersListGuid update WF40500 set WF_Auto_Delegate_Tasks=0 where WF_Auto_Delegate_Tasks=1 and UsersListGuid in (select UsersListGuid from @UserDelegationDates where ENDDATE<SYSDATETIME()) END

Then after hitting OK, this error:

ERROR [Microsoft][SQL Server Native Client 11.0][SQL Server]Failed to create AppDomain "DYNAMICS.dbo[runtime].30".
Could not load file or assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. No

I have run this multiple times and it fails at the same stored procedure each time. This is the first time I have tried to create a company after upgrading to GP2013 12.00.1826. Any ideas would be appreciated. 

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: GP Utilities Fails to create new company

    Hello, and thanks for the responses. Yes, I did restart the server. However, I am still running into the same issue of GP Utilities not creating the database.

    EDIT:

    I decided to try this method again and it worked for me. 

    This time, I waited until after hours and on a weekend to access the server, checked the ACTIVITY table to make sure all users were out of GP, then restarted the server. On restart, I didn't run any additional applications, just GP utilities and I was able to create the new Database. 

    Thanks to everyone that responded to this thread.

    Jason

  • Verified answer
    Arunsh Profile Picture
    Arunsh 606 on at
    RE: GP Utilities Fails to create new company

    Hi friend,

    Did you try restarting your machine?.  I had exactly the same issue with same error message. I just restarted the machine and ran the utilities. Really, it worked charming. :)

    Have a nice day.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: GP Utilities Fails to create new company

    The upgrade was fine, and had no issue. There were 13 total companies upgraded during the process, and I did not bring along the test company that was present in the old environment, as I was just going to use Utilities to create one from scratch.

    The only time I'm running into this is when creating a new company via Utilities.

    Obvious for sure, but true none the less! Any direction would be appreciated, this has given me a headache for at least a week. Thanks!

  • Tom Cruse Profile Picture
    Tom Cruse 1,475 on at
    RE: GP Utilities Fails to create new company

    it's odd that it's referencing the WF tables because those are workflow tables and they don't exist in GP2013, they make their first appearance in GP2013 R2.

    are you receiving the error when you try to upgrade or is it when you try to create a brand new company in Utilities? it seems that there's a version mismatch somewhere. Something isn't quite right, that might be stating the obvious :)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: GP Utilities Fails to create new company

    The System.Data.dll is present in both directories you listed. Thanks for the response.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: GP Utilities Fails to create new company

    Is .Net 4.0 or .Net 4.5 Installed on the Server, as the error states that the System.Data.dll assembly can't be found.  Exists in the below directories;

    (32-bit) [WINDIR]\Microsoft.NET\Framework\v4.0.30319

    (64-bit) [WINDIR]\Microsoft.NET\Framework64\v4.0.30319

    WINDIR = Windows Directory Root (eg. C:\Windows)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans