Errors have been found in this check batch. Please correct the errors before printing

Today our AP Department called in and reported they were not able print checks, and when our AP Department calls in, some is wrong, they can handle almost any AP GP functions and issues.  Got the error messages it just reads as follows:

Check batch errors

As routine question asked the AP team, did you print the edit list and were there any errors reported on it ?  As expected got a neatly organized and crisp report – no point reviewing it, sure it would have been already done, but I have asked it have to review it,  completed the formality,  as expected it wasn’t helpful.

Based on experience knew that one of the vendor in the check batch is not active which is causing the error, the problem is how do we identify the vendor for a batch of 60  odd checks ?

Solution:
1) Generated  just in time Dex SQL Log, which did list the last vendor information when error occurred.  We were able to activate the vendor and when reprocessed the batch again the problem re appeared.

2) We realized that the recent vendor reorganization process where multiple vendors were inactivated (Yes – not from GP) is the root cause for the problem, another reason why we should not update GP tables outside GP.  There are other vendors in the check batch who needs to be activated.  Is there a easy way ?  The Dex SQL is ok, but is sequential and stops after every error.

3) Decided to write a SSRS Report quickly to check vendor status of all check batch vendors.  Which table is the payment info stored ?  Identifying the table  was not a problem,  all I had to do was to  connect to   http://www.sanjaykumar.us/index.php/category/dynamics-gp/tables-dynamics-gp/pm/
and search for the word work….
payment work

The table we needed was PM10300.   Writing the query there after was a flash….

DECLARE @batchnumb AS VARCHAR(21) 

SELECT @batchnumb = '?' 

SELECT vendorid, 
       vendname, 
       CASE vendstts 
         WHEN 1 THEN 'Active' 
         WHEN 2 THEN 'In Active' 
         WHEN 3 THEN 'Temp' 
       END AS status 
FROM   pm00200 WITH (nolock) 
WHERE  vendorid IN (SELECT vendorid 
                    FROM   pm10300 WITH (nolock) 
                    WHERE  bachnumb = @Batchnumb) 
       AND vendstts <> 1

This query returns active vendors not active at check batch and is delivered through SSRS report.  Now Our AP Department can manage this the situation themselves!  Turned out to be Happy Halloween after all.

Cheers!
Sanjay

e Connect example – Create Vendor with multiple addresses,email address and internet info

vendorcard

Imports System
Imports System.Xml
Imports System.Xml.Serialization
Imports System.IO
Imports System.Text
Imports Microsoft.VisualBasic
Imports Microsoft.Dynamics.GP.eConnect
Imports Microsoft.Dynamics.GP.eConnect.Serialization

Public Class vENDORCREATE
    Public Sub eConnectSend()
        'Serialized XML File         
        Dim xmldocument As String
        'Connection String         
        Dim sConnectionString As String
        'Result         
        Dim xmlobject As String
        Using eConCall As New eConnectMethods
            Try
                SerializeObject("c:\test\xmlfile.xml ")
                Dim xmldoc As New Xml.XmlDocument
                xmldoc.Load("c:\test\xmlfile.xml")
                xmldocument = xmldoc.OuterXml
                sConnectionString = "data source=zfc-php;initial catalog=two;integrated security=SSPI; persist security info=False;packet size=4096"
                xmlobject = eConCall.CreateTransactionEntity(sConnectionString, xmldocument)
            Catch exp As eConnectException
                MsgBox(exp.ToString)
            Catch ex As System.Exception
                MsgBox(ex.ToString)
            Finally
                eConCall.Dispose()
                MsgBox("done")
            End Try
        End Using
    End Sub
    Public Shared Sub SerializeObject(ByVal filename As String)
        Try
            Dim econnect As New eConnectType
            Dim vendor As New PMVendorMasterType
            'Vendor record
            Dim vendorrecord As New taUpdateCreateVendorRcd
            With vendorrecord
                .VENDORID = "VENDORID"
                .VENDNAME = "Name"
                .VADDCDPR = "PRIMARY"
                .VADCDSFR = "SHIPFROM"
                .VADCDTRO = "REMITTO"
                .VNDCNTCT = "PRIMARYCONTACT"
                .CreateAddress = 1
                .UpdateIfExists = 1
            End With
            vendor.taUpdateCreateVendorRcd = vendorrecord

            'Address - Primary
            Dim adressarray(2) As taCreateVendorAddress_ItemsTaCreateVendorAddress
            Dim addessobject1 As New taCreateVendorAddress_ItemsTaCreateVendorAddress
            With addessobject1
                .VENDORID = "VENDORID"
                .ADRSCODE = "PRIMARY"
                .ADDRESS1 = "Address 1"
                .ADDRESS2 = "Address 2"
                .ADDRESS3 = "Address 3"
                .VNDCNTCT = "PRIMARYCONTACT"
                .CITY = "City"
                .STATE = "CO"
                .ZIPCODE = "80526"
                .PHNUMBR1 = "2017070162"
                .PHNUMBR2 = "2017070162"
                .PHNUMBR3 = "2017070162"
                .FAXNUMBR = "2017070162"
                .CCode = "US"
                .COUNTRY = "USA"
                .CITY = "Fort Collins"
            End With
            adressarray(0) = addessobject1

            Dim addessobject2 As New taCreateVendorAddress_ItemsTaCreateVendorAddress
            With addessobject2
                .VENDORID = "VENDORID"
                .ADRSCODE = "REMITTO"
                .ADDRESS1 = "Address 1"
                .ADDRESS2 = "Address 2"
                .ADDRESS3 = "Address 3"
                .CITY = "City"
                .STATE = "CO"
                .ZIPCODE = "80526"
                .PHNUMBR1 = "2017070162"
                .PHNUMBR1 = "2017070162"
                .PHNUMBR2 = "2017070162"
                .PHNUMBR3 = "2017070162"
                .FAXNUMBR = "2017070162"
                .CCode = "US"
                .COUNTRY = "USA"
                .CITY = "Fort Collins"
                .VNDCNTCT = "REMITTOCONTACT"
            End With
            adressarray(1) = addessobject2

            Dim addessobject3 As New taCreateVendorAddress_ItemsTaCreateVendorAddress
            With addessobject3
                .VENDORID = "VENDORID"
                .ADRSCODE = "SHIPFROM"
                .ADDRESS1 = "Address 1"
                .ADDRESS2 = "Address 2"
                .ADDRESS3 = "Address 3"
                .CITY = "City"
                .STATE = "CO"
                .ZIPCODE = "80526"
                .PHNUMBR1 = "2017070162"
                .PHNUMBR1 = "2017070162"
                .PHNUMBR2 = "2017070162"
                .PHNUMBR3 = "2017070162"
                .FAXNUMBR = "2017070162"
                .CCode = "US"
                .COUNTRY = "USA"
                .CITY = "Fort Collins"
                .VNDCNTCT = "SHIPFROMCONTACT"
            End With

            adressarray(2) = addessobject3
            vendor.taCreateVendorAddress_Items = adressarray

            'Internet address
            Dim internetaddress(0) As taCreateInternetAddresses_ItemsTaCreateInternetAddresses
            Dim INERNETADDRESS1 As New taCreateInternetAddresses_ItemsTaCreateInternetAddresses
            With INERNETADDRESS1
                .ADRSCODE = "PRIMARY"
                .INET1 = "EMAIL"
                .Master_ID = "VENDOR"
                .Master_Type = "VEN"
            End With
            internetaddress(0) = INERNETADDRESS1
            vendor.taCreateInternetAddresses_Items = internetaddress

            ReDim Preserve econnect.PMVendorMasterType(0)
            econnect.PMVendorMasterType(0) = vendor

            Dim fs As New FileStream(filename, FileMode.Create)
            Dim writer As New XmlTextWriter(fs, New UTF8Encoding)
            Dim serializer As New XmlSerializer(GetType(eConnectType))
            serializer.Serialize(writer, econnect)
            writer.Close()
        Catch ex As ApplicationException
            MsgBox(ex.ToString)
        End Try
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        eConnectSend()
    End Sub
End Class

 

Element name Data type Length Required Description
CUSTNMBR string 15 Y Customer number
HOLD i4 1 N Hold status:
0=Not on hold;
1=On hold
Default is zero on new record
INACTIVE i4 1 N Inactive:
0=Active;
1=Inactive
Default is zero on new record
CUSTNAME string 64 N Customer name
SHRTNAME string 15 N Short name; if not passed in, default is CUSTNAME
STMTNAME string 64 N Statement name; if not passed in, default is CUSTNAME
CUSTCLAS string 15 N Customer class ID
CUSTPRIORITY i4 2 N Customer priority; valid input values 1 (none) to 100
Default is one on new record
ADRSCODE string 15 N Primary address ID
CNTCPRSN string 60 N Contact person
ADDRESS1 string 60 N Customer address one
ADDRESS2 string 60 N Customer address two
ADDRESS3 string 60 N Customer address three
CITY string 35 N City
STATE string 29 N State
ZIPCODE string 10 N Zip code
CCode string 6 N Country code
COUNTRY string 60 N Country
PHNUMBR1 string 21 N Phone one
PHNUMBR2 string 21 N Phone two
PHNUMBR3 string 21 N Phone three
FAX string 21 N Fax
UPSZONE string 3 N UPS zone
SHIPMTHD string 15 N Shipping method
TAXSCHID string 15 N Tax schedule ID
SHIPCOMPLETE i4 1 N Ship complete documents:
0=False;
1=True
Default is zero on new record
PRSTADCD string 15 N Primary ship to address code
PRBTADCD string 15 N Primary bill to address code
STADDRCD string 15 N Statement to address code
SLPRSNID string 15 N Salesperson ID
SALSTERR string 15 N Sales territory
USERDEF1 string 20 N User-defined one
USERDEF2 string 20 N User-defined two
COMMENT1 string 30 N Comment one
COMMENT2 string 30 N Comment two
CUSTDISC number 21 N Trade discount
PYMTRMID string 20 N Payment terms ID
DISGRPER i4 2 N Discount grace period
DUEGRPER i4 2 N Due date grace period
PRCLEVEL string 10 N Price level
NOTETEXT string 8000 N Note text
BALNCTYP i4 1 N Balance type:
0=Open item;
1=Balance forward
Default is zero on new record
FNCHATYP i4 2 N Finance charge type:
0=None;
1=Percent;
2=Amount
Default is zero for new record
FNCHPCNT number 21 N Finance charge percent; used if FNCHATYP=1
FINCHDLR number 21 N Finance charge dollar; used if FNCHATYP=2
MINPYTYP i4 2 N Minimum payment type:
0=No minimum;
1=Percent; 2=Amount
Default is zero for new record
MINPYPCT number 21 N Minimum payment percent; used if MINPYTYP=1
MINPYDLR number 21 N Minimum payment dollar amount; used if MINPYTYP=2
CRLMTTYP i4 2 N Credit limit type:
0=No credit;
1=Unlimited;
2=Amount
Default is zero on new record
CRLMTAMT number 21 N Credit limit amount; used if CRLMTTYP=2
CRLMTPER i4 2 N Credit limit period; used if CRLMTTYP=2 and the credit limit warning is used in Microsoft Dynamics GP application
CRLMTPAM number 21 N Credit limit period amount; used if CRLMTTYP=2 and the credit limit warning is used in Microsoft Dynamics GP application
MXWOFTYP i4 2 N Maximum write-off type: 0=Not allowed;
1=Unlimited;
2=Maximum
Default is zero for new record
MXWROFAM number 21 N Maximum write-off amount; used if MXWOFTYP=2
Revalue_Customer i4 1 N Revalue customer:
0=Do not revalue;
1=Revalue
Default is one for new record
Post_Results_To i4 2 N Post results to:
0=Receivables/Discount Account;
1=Sales offset
Default is zero on new records
ORDERFULFILLDEFAULT i4 1 N Order fulfillment shortage:
1=None;
2=Back order remaining;
3=Cancel remaining
Default is one on new record
INCLUDEINDP i4 1 N Include in demand planning: 0=Do not include;
1=Include
Default is one on new record
CRCARDID string 15 N Credit card ID
CRCRDNUM string 20 N Credit card number
CCRDXPDT datetime 16 N Credit card expiration date
BANKNAME string 30 N Bank name
BNKBRNCH string 20 N Bank branch
USERLANG i4 2 N User language; default is zero on new record
TAXEXMT1 string 25 N Tax exempt one
TAXEXMT2 string 25 N Tax exempt two
TXRGNNUM string 25 N Tax registration number
CURNCYID string 15 N Currency ID
RATETPID string 15 N Rate type ID
STMTCYCL i4 2 N Statement Cycle:
1=No Statement;
2=Weekly;
3=Biweekly;
4=Semimonthly;
5=Monthly;
6=Bimonthly;
7=Quarterly
KPCALHST i4 1 N Maintain history—calendar year:
0=Do not maintain history;
1=Maintain history
Default is 1 on new record
KPERHIST i4 1 N Maintain history—fiscal year:
0=Do not maintain history;
1=Maintain history
Default is 1 on new record
KPTRXHST i4 1 N Maintain history—transaction:
0=Do not maintain history;
1=Maintain history
Default is 1 on new record
KPDSTHST i4 1 N Maintain history—distribution:
0=Do not maintain history;
1=Maintain history
Default is 1 on new record
Send_Email_Statements i4 1 N Send e-mail statements:
0=Do not sent statements;
1=Send statements
Default is zero on new record
ToEmail_Recipient string 80 N To email recipient; separate each recipient with a semicolon
CcEmail_Recipient string 80 N Carbon copy email recipient; separate each recipient with a semicolon
BccEmail_Recipient string 80 N Blind carbon copy email recipient; separate each recipient with a semicolon
CHEKBKID string 15 N Checkbook ID
DEFCACTY i4 2 N Cash account from: 0=Checkbook;
1=Customer
Default is zero on new record
RMCSHACTNUMST string 75 N Cash account; only valid if DEFCACTY=1
RMARACTNUMST string 75 N Accounts receivable account
RMSLSACTNUMST string 75 N Sales account
RMCOSACTNUMST string 75 N Cost of sales account
RMIVACTNUMST string 75 N Inventory account
RMTAKACTNUMST string 75 N Terms discount taken account
RMAVACTNUMST string 75 N Terms discount available account
RMFCGACTNUMST string 75 N Finance charges account
RMWRACTNUMST string 75 N Write-offs account
RMSORACTNUMST string 75 N Sales order returns account
RMOvrpymtWrtoffACTNUMST string 75 N Overpayment write-offs account
GPSFOINTEGRATIONID string 30 N Front office integration ID
INTEGRATIONSOURCE i4 2 N Integration source
INTEGRATIONID string 30 N Integration ID
UseCustomerClass i4 1 N Flag to have class setting roll down to elements not passed in; uses the CUSTCLAS class to roll down
CreateAddress i4 1 N Flag to allow a primary address code to be created on the fly:
0=Do not create address code;
1=Create address code
UpdateIfExists i4 1 N Flag to allow customer data to be updated if it exists:
0=Do not update;
1=Update if record exists;
2=Create if record does not exist and exits without error if record does exist
RequesterTrx i4 2 N Requester transaction:
0=False;
1=True (if True, it populates the requester shadow table)

Cheers!

Sanjay