web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

MRP in a test company

(0) ShareShare
ReportReport
Posted on by

Hello,

Has anyone used MRP in a test company?  Our live works (mostly but no errors)  I am trying to get it to work in test so I can play around with tweaking some settings but it just causes an error and then I cant do any manufacturing/inventory transactions.  It is the same error each time.  It is Violation of primary key PKmrp0101 (shows a item # and location) but there is nothing in this table..

If I restore any timeframe of the database it does the same.  Anybody have any ideas?  Thanks

Rick

*This post is locked for comments

I have the same question (0)
  • soma Profile Picture
    24,410 on at

    Many times I have tried to run the MRP process in test company. But, I didn't receive any errors especially the error which you have posted. Better restore the live company database in test DB and test again.

    Hope this helps!!!

  • Rick Heinrichs Profile Picture
    on at

    I did 6 times today of different time frames of the live.  same error.

  • soma Profile Picture
    24,410 on at

    Have you tried to restored the company & system db from live to test?

  • Rick Heinrichs Profile Picture
    on at

    unfortunately that is not realistic for others to test.  I need the test company on the live to work.  Also it is currently in a different version GP2013 R2

  • soma Profile Picture
    24,410 on at

    Any update?

  • Rick Heinrichs Profile Picture
    on at

    I restored a backup from April with the same results "Violation of PRIMARY KEY constraint PKMRP0101" cannot insert duplicate key in object MRP0101...

  • soma Profile Picture
    24,410 on at

    Have you tried this on Fabrikam company? Also check both the live and test GP are same version.

    Hope this helps!!!

  • Rick Heinrichs Profile Picture
    on at

    Fabrikam works (so do my live companies).  They should be the same version because they are a copy of live within the last week and we haven't upgraded since January...

  • soma Profile Picture
    24,410 on at

    I think something is missing in your company setup for MRP or Manufacturing (don't know the real cause for this issue). Better create a new company and the try the same or contact your partner to resolve the same.

    Hope this helps!!!

  • Verified answer
    Redbeard Profile Picture
    12,931 on at

    Rick,

    I have managed to get MRP to work in test companies fine - just did this again in 2013 for the express purpose of validating this wasn't a newly introduced problem - my build is 12.00.1570 (GP2013 SP2).  I don't know how much experience you have creating test companies, but it is imperative to follow the instructions laid out in the following KB871973:

    support.microsoft.com/.../871973

    Most importantly run the following SQL Script against the company database after you copy it from your Live DB to your Test DB:

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
mtabor Profile Picture

mtabor 1

#2
Victoria Yudin Profile Picture

Victoria Yudin 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans