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

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

Change next Purchase Order Number in RMS

(0) ShareShare
ReportReport
Posted on by

I've tried to reset the next purchase order number in RMS using the below sql query.

DECLARE @NewPO NVARCHAR(20), @OldPO NVARCHAR(20)

SET @NewPO = 'NewPONumberHere'

SET @OldPO = 'OldPONumberHere'

UPDATE PurchaseOrder SET PONumber = @NewPO WHERE PONumber = @OldPO

AND @NewPO NOT IN (SELECT PONumber FROM PurchaseOrder)

this works in changing the current purchase order number but the next purchase order number reverts back to 10000000 and then I get a message that this number has been entered for another purchase order or inventory transfer. How do I get the next purchase order number to reset to something that hasn't been used before

Many thanks in advance

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Change next Purchase Order Number in RMS

    Looks like you know sql server pretty well.  You need to change the identity seed number in the master table for the PurchaseOrder table.  

    If your not sure how to do that.  This is the basic command.  DBCC CHECKIDENT (PurchaseOrder, RESEED, 12345)

  • Community Member Profile Picture
    on at
    RE: Change next Purchase Order Number in RMS

    DBCC CHECKIDENT (PurchaseOrder, RESEED, 12345)

    I tried running this command on a test database (one that is not actually having a problem) and it did not change the next number to 12345 or 12346.  I also tried running the same command with the next number to be 0010000 which is a number I know we havn't used.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Change next Purchase Order Number in RMS

    Which version of Sql Server are you running?

  • Community Member Profile Picture
    on at
    RE: Change next Purchase Order Number in RMS

    SQL Express 2005 in test environment, SQL Server 2008 R2 in live environment

  • Community Member Profile Picture
    on at
    RE: Change next Purchase Order Number in RMS

    is this tested ??

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans