Reference Number not unique for this customer or... error message

SOLVED

Greetings,


Our product allows a user to push invoices from our system in to a Sage 50 system. We use the .NET SDK for integration. We're having problems at a specific customers site.

The scenario is as follows. The user "closed" out some books (I presume closed out some old accounting periods). The invoice in question was created this month, so I don't suspect it has anything in particular to do with the closing of the books, but the customer mentioned it as the triggering event that may have caused this.

They then used our product to POST an invoice in to Sage 50. Our system believed that the POST to Sage 50 functioned fine (we caught no exceptions in the process of POSTing the Sales Invoice to Sage 50). However, the user went in to Sage 50, searched for the Invoice number, and could not find the invoice. They they called us to try to troubleshoot what was happening.

I opened their Sage 50 and using the basic search feature within the Sales Invoice List, was not able to find the invoice (searching by Invoice Number).

I cleared our system to let me try to POST the invoice again from our product in to Sage 50.

When we attempt to POST this invoice to Sage 50, we get the following error from the Sage 50 SDK (this error happens during our call to Validate() function within the Sage.Peachtree.API.SalesInvoice class):

Reference number is not unique for this customer or vendorReference number is used by another customer or vendor.

To me, this seems to be telling me that Sage realizes it already has this Invoice (from the very first time the user POSTed it). But yet, when I search for the Invoice, I cannot find it. We made sure that the Date Range setting in the Sales Invoice List was set to "All Transactions".

Any ideas? I half think this is just a setting in the Sage 50 client; that even though I set the system to search "All Transactions", I'm still only looking at a subset of the data.

Many thanks!

  • 0
    verified answer

    The problem could be based on data corruption from the closed years. If you get a database corruption issue, it can be hard to diagnose without stepping through the code or looking at the database fields in the tables. Many times network traffic errors, power glitches or a problem in the computer bus of the computer that closed the years corrupts a DB record. The computer then writes data into database fields causing an overrun into the next adjoining field.

    Try the data verification steps and see what errors you get on the database.

  • 0

    Are you able to find the transaction by using the List views?

  • 0 in reply to Bill_Coleman
    SUGGESTED

    Greetings all.

    Thanks to Bill and Scott to contributing to this message.

    In the end, the Sage company database was corrupt. The company ran through the Data Verification steps, and I believe had to do some other repairs on the database (they had a Sage service contract and worked with Sage on the issue) and were able to clear up the issue.

    Unfortunately we have another company with the same issue that does not have a support contract. So progress on that issue is moving more slowly.

    But the lesson learned here is that the Data Verification tools are a good thing, and something worth attempting in troubleshooting this issue.

  • +1
    verified answer

    I literally had this issue happen today at a customer site. I google for the "Sage 50 reference number not unique" and came across this post. I began reading it, and noticed it sounded familiar - since I wrote the initial post 6 or so years ago!

    I fixed today's problem/customer a little differently. So I thought I'd make note of it here (so hopefully in 5-6 years when it happens again I'll search and find this post yet again). This time, I ran the Data Verification tools, which did fix a whole mess of issues, but I was still getting the same error when posting Invoices.


    Long story short, when I ran a ListCompany() function to get all of the databases/companies that Sage 50 knew about, the company in question was listed as being local on the C:\ drive. However, I noticed when actually using Sage 50, the user was opening the company file on a shared network drive (not C:).. Long story short, I navigated to the ProgramData\Sage directory and edited the Peachtree ini file that's present. Change the Base Company path there from the C:\ location to the network mapped drive location and restarted Sage 50. Everything integrated fine after. So... mental note and Hi future fuerstma!