Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Selected Company Not Configured as a company....

Posted on by 25,195

I have a client that is getting the error "The selected company is not configured as a company of the current Microsoft Dynamics GP system database...."  We created this new company by (a) using GP Utilities to create a company (b) restore a copy of the live database to this db (c) attempt to login and get this message.

Any suggestions or resolutions would be appreciated.

*This post is locked for comments

  • TD2012 Profile Picture
    TD2012 935 on at
    RE: Selected Company Not Configured as a company....

    I did as Sheri and this removed the error when logging in to the company.  Although I did get a couple of errors on the script referencing UPR70105 and G curso, but it didn't terminate the script and test company seems to work ok.    The original script worked on GP2013 just fine until the 2015 year-end update, then I received the company configuration error.  Thank you!  A great help to find this when working on Sunday.

  • Sheri Ibbotson Profile Picture
    Sheri Ibbotson 712 on at
    RE: Selected Company Not Configured as a company....

    Just a note:  I ran this new InterID script by selecting the database in SQL first and then Iran the script after the "go" command - this script resolved the "Selected Company Not Configured as a company.." error I was seeing when I logged into a newly created company in GP2015R2  - thanks again for the script

  • L Vail Profile Picture
    L Vail 65,271 on at
    RE: Selected Company Not Configured as a company....

    Thanks Jim,

    I changed the beginning of the script to:

    USE dynamics

    go

    and it worked perfectly. Hmm..  Just to be complete, here's the text of the script Jim uses :).

    if exists (select 1 from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'SY00100') begin

     declare @Statement varchar(850)

     select @Statement = 'declare @cStatement varchar(255)

    declare G_cursor CURSOR for

    select case when UPPER(a.COLUMN_NAME) in (''COMPANYID'',''CMPANYID'')

     then ''update ''+a.TABLE_NAME+'' set ''+a.COLUMN_NAME+'' = ''+ cast(b.CMPANYID as char(3))

     else ''update ''+a.TABLE_NAME+'' set ''+a.COLUMN_NAME+'' = ''''''+ db_name()+'''''''' end

    from INFORMATION_SCHEMA.COLUMNS a, '+rtrim(DBNAME)+'.dbo.SY01500 b

     where UPPER(a.COLUMN_NAME) in (''COMPANYID'',''CMPANYID'',''INTERID'',''DB_NAME'',''DBNAME'')

       and b.INTERID = db_name() and COLUMN_DEFAULT is not null

    and rtrim(a.TABLE_NAME)+''-''+rtrim(a.COLUMN_NAME) <> ''SY00100-DBNAME''

     order by a.TABLE_NAME

    set nocount on

    OPEN G_cursor

    FETCH NEXT FROM G_cursor INTO @cStatement

    WHILE (@@FETCH_STATUS <> -1)

    begin

     exec (@cStatement)

     FETCH NEXT FROM G_cursor INTO @cStatement

    end

    close G_cursor

    DEALLOCATE G_cursor

    set nocount off'

     from SY00100

     exec (@Statement)

    end

    else begin

     declare @cStatement varchar(255)

     declare G_cursor CURSOR for

     select case when UPPER(a.COLUMN_NAME) in ('COMPANYID','CMPANYID')

       then 'update '+a.TABLE_NAME+' set '+a.COLUMN_NAME+' = '+ cast(b.CMPANYID as char(3))

       else 'update '+a.TABLE_NAME+' set '+a.COLUMN_NAME+' = '''+ db_name()+'''' end

     from INFORMATION_SCHEMA.COLUMNS a, DYNAMICS.dbo.SY01500 b

       where UPPER(a.COLUMN_NAME) in ('COMPANYID','CMPANYID','INTERID','DB_NAME','DBNAME')

         and b.INTERID = db_name() and COLUMN_DEFAULT is not null

       order by a.TABLE_NAME

     set nocount on

     OPEN G_cursor

     FETCH NEXT FROM G_cursor INTO @cStatement

     WHILE (@@FETCH_STATUS <> -1)

     begin

       exec (@cStatement)

       FETCH NEXT FROM G_cursor INTO @cStatement

     end

     close G_cursor

     DEALLOCATE G_cursor

     set nocount off

    end

  • Jim Lines Profile Picture
    Jim Lines 2 on at
    RE: Selected Company Not Configured as a company....

    Thanks Leslie!

    I had a problem with this script and kept getting this error:  Incorrect syntax near 'G_cursor'. I think it may be something lost in my copy/paste.  I had success with this KB: support.microsoft.com/.../872370

    Based on the article in the first link you provided though, I'm hoping that the script in the KB is the latest.

    Thanks!

    Jim

  • Suggested answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Selected Company Not Configured as a company....

    I just notices my link pointed to an image.  I looked around a bit and found where Frank Hammely had posted the script such that it could be copied.  Here it is:

    USE XXXX (database)

    if exists (select 1 from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'SY00100') begin

    declare @Statement varchar(850)

    select @Statement = 'declare @cStatement varchar(255)

    declare G_cursor CURSOR for

    select case when UPPER(a.COLUMN_NAME) in (''COMPANYID'',''CMPANYID'')

    then ''update ''+a.TABLE_NAME+'' set ''+a.COLUMN_NAME+'' = ''+ cast(b.CMPANYID as char(3))

    else ''update ''+a.TABLE_NAME+'' set ''+a.COLUMN_NAME+'' = ''''''+ db_name()+'''''''' end

    from INFORMATION_SCHEMA.COLUMNS a, '+rtrim(DBNAME)+'.dbo.SY01500 b

    where UPPER(a.COLUMN_NAME) in (''COMPANYID'',''CMPANYID'',''INTERID'',''DB_NAME'',''DBNAME'')

      and b.INTERID = db_name() and COLUMN_DEFAULT is not null

    and rtrim(a.TABLE_NAME)+''-''+rtrim(a.COLUMN_NAME) <> ''SY00100-DBNAME''

    order by a.TABLE_NAME

    set nocount on

    OPEN G_cursor

    FETCH NEXT FROM G_cursor INTO @cStatement

    WHILE (@@FETCH_STATUS <> -1)

    begin

    exec (@cStatement)

    FETCH NEXT FROM G_cursor INTO @cStatement

    end

    close G_cursor

    DEALLOCATE G_cursor

    set nocount off'

    from SY00100

    exec (@Statement)

    end

    else begin

    declare @cStatement varchar(255)

    declare G_cursor CURSOR for

    select case when UPPER(a.COLUMN_NAME) in ('COMPANYID','CMPANYID')

      then 'update '+a.TABLE_NAME+' set '+a.COLUMN_NAME+' = '+ cast(b.CMPANYID as char(3))

      else 'update '+a.TABLE_NAME+' set '+a.COLUMN_NAME+' = '''+ db_name()+'''' end

    from INFORMATION_SCHEMA.COLUMNS a, DYNAMICS.dbo.SY01500 b

      where UPPER(a.COLUMN_NAME) in ('COMPANYID','CMPANYID','INTERID','DB_NAME','DBNAME')

        and b.INTERID = db_name() and COLUMN_DEFAULT is not null

      order by a.TABLE_NAME

    set nocount on

    OPEN G_cursor

    FETCH NEXT FROM G_cursor INTO @cStatement

    WHILE (@@FETCH_STATUS <> -1)

    begin

      exec (@cStatement)

      FETCH NEXT FROM G_cursor INTO @cStatement

    end

    close G_cursor

    DEALLOCATE G_cursor

    set nocount off

    end

    Thanks Frank!

    Kind regards,

    Leslie

  • L Vail Profile Picture
    L Vail 65,271 on at
    RE: Selected Company Not Configured as a company....

    Hi,

    The new script can be found here: dynamicsuniversity.com/.../error-selected-company-not-configured-company-current-microsoft-dynamics-gp-system-database

    Kind regards,

    Leslie

  • Bron Profile Picture
    Bron 4,887 on at
    RE: Selected Company Not Configured as a company....

    FYI - I always use SQL to update the company id to the correct value and  never have a problem.......I looked for a different company id script and haven't found anything.

    Jim - if you find something let us know.........

  • Jim Lines Profile Picture
    Jim Lines 2 on at
    RE: Selected Company Not Configured as a company....

    Guys,

    I'm having the same issue with GP 2013.  I ran the InterID script as normal and still have the problem.  When I look at SY00100, the DB name is indeed Dynamics, but the CMPANYID is incorrect.  It is set to the company in which I made the copy.   This is leading me to believe that my InterID script is not correct.  The version I am using has this header:

    /*Revised May 2013 to work with Microsoft Dynamics GP 2013*/

    /*This script is supported with Microsoft Dynamics GP 10.0, 2010 and 2013*/

    Do either of you have the most recent copy so I can see if perhaps my script got changed?  I'm in my dev environment so I am no two worried about breaking anything.  

    Thanks in advance!

    Jim

  • Richard Whaley Profile Picture
    Richard Whaley 25,195 on at
    RE: Selected Company Not Configured as a company....

    That was it exactly...thanks

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Selected Company Not Configured as a company....

    Hi Richard,

    Have you run the InterID script that needs to be run after a restore?

    Maybe look in the SY00100 table. check that the DBNAME field says 'DYNAMICS'

    Ian.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans