Hello Everyone,

Today we are going to talk about an error message that can be misleading and send us down the wrong path when troubleshooting. The error message I am referring to happens when you open the Transaction by Vendor or Transaction by Document is below.

“Cannot insert the value NULL into column ‘DOCTYABR’ table tempdb.dbo.##0135356, column does not allow nulls. INSERT fails”

“The stored procedure pmBuildTrxINquiryByDateRange returned the following results. DBMSL 515, Microsoft Dynamics GP:0”

The error above is misleading because it references a DOCTYABR column that does not exist. It is telling us there is an issue with the DOCTYPE column in the PM00400 table.

When I see this case, it is due to a DOCTYPE being 0 or blank which is not valid. Our Doc Types are:

  1. 1 = Invoice
  2. 2 = Finance Charge
  3. 3 = Miscellaneous Charge.
  4. 4 = Return
  5. 5 = Credit Memo
  6. 6 = Payment.

It can also mean that the DCSTATUS is blank or 0. Our valid DCSTATUS variables are:

  1. 1 = Work
  2. 2 = Open
  3. 3 = History.

To help identify these issues, we can use the select statements below.

Select * from PM00400 where DCSTATUS = ''

Select * from PM00400 where DCSTATUS = '0'

Select * from PM00400 where DOCTYPE = ''

Select * from PM00400 where DOCTYPE = '0'

Once you locate the bad records in the PM00400, you can review the results of the transaction tables to determine if there is any damage and make corrections as needed.

If the only thing that is damaged is the PM00400 record, the correction to this issue is:

I recommend testing this in a test company with a copy of live data to ensure that you receive the results you are looking for:

KB 871973 How to set up a test company that has a copy of live company data by using SQL Server 7.0, SQL Server 2000, or SQL Server 2005

https://support.microsoft.com/en-us/help/871973/set-up-a-test-company-that-has-a-copy-of-live-company-data-for-microsoft-dynamics-gp-by-using-microsoft-sql-server

  1. Delete the PM00400 record that is damaged using SQL.
  2. Run Check Links on the Payables Transaction Logical and Payables History Logical File to recreate the Key Record.

This usually clears up the error.

I hope this helps and saves you a call to support.

Thank you!

Microsoft Support Engineer | Brandon Jarrett