Data Type Conversion Errors in Explore - GL Transactions

I was testing out the AP Module that we just acquired and posted a batch of vouchers. When attempting to run the GL Account Transactions task to view these posted transactions, I ran into two different errors: 

The varchar values it's referring to were entered into the "Invc No" field within the Enter Vouchers window. 

It doesn't seem like the issue lies within what's entered into the AP module, but rather how the Explore GL Transactions data view grid is configured.

I'm not sure where to go from here, so any help would be appreciated. Thanks!

Parents
  • 0

    Can you run the following query on your database and reply back with the results?

    Knowing the value came from "Invc No" is a big help.  Is the 414... number also an "Invc No"?


    SELECT
    	*
    FROM 
    	tsmModule
    WHERE
    	ModuleNo = 1
    
    SELECT 
    	LEFT(SOBJ.name,20) 'View Name'
    	,LEFT(SCOL.name,30) 'Col Name'
    	,LEFT(ST.name,20) 'Col Type'
    	,SCOL.column_id 'Col No'
    	,SCOL.max_length
    	,SCOL.precision
    	,SCOL.scale
    FROM 
    	Sys.Objects SOBJ
    		INNER JOIN sys.columns SCOL ON
    			SCOL.object_id = SOBJ.object_id
    		INNER JOIN sys.types ST ON
    			ST.system_type_id = SCOL.system_type_id
    WHERE 
    	SOBJ.name = 'vdvglAccountTran'
    ORDER BY
    	SCOL.column_id
    

  • 0 in reply to Ramon M.

    Ramon, the base view does not appear to be correctly coded. The tapVoucher table should not be joined. That join creates a potential performance problem when posting in detail, which populates each transaction for each account whereas summary aggregates the batch total in each account. The original intention was to allow filtering and reporting by batch for summary posting, or filtering and reporting by transaction according to source module/transaction type and transaction (TranNo) when posting in detail. Someone probably requested an enhancement to filter or reference the vendor invoice, but that's not valid in the general context of how this view is used.

    The view was modified by version 7.4, so the 7.05 view is different and does not reference tapVoucher.

    /* vdvglAccountTran - CREATE VIEW */
    
    CREATE VIEW vdvglAccountTran AS SELECT dbo.tglAcctRef.AcctRefCode, dbo.tglAcctRef.Description AS AcctRefDesc, dbo.tciBatchLog.BatchNo, dbo.tciBatchLog.PostUserID, dbo.tciBatchLog.BatchID, dbo.tglTransaction.CreateDate, dbo.tglTransaction.CreateType, dbo.v
    ListValidationString.LocalText AS CreateTypeAsText, dbo.tglTransaction.CurrExchRate, dbo.tglTransaction.CurrID, dbo.tglTransaction.ExtCmnt, dbo.tglJournal.Description AS JrnlDesc, dbo.tglJournal.JrnlID, dbo.tglTransaction.JrnlNo, dbo.tglTransaction.PostAm
    t, dbo.tglTransaction.PostAmtHC, dbo.tglTransaction.PostCmnt, dbo.tglTransaction.PostDate, dbo.tglTransaction.PostQty, dbo.tsmModuleDef.ModuleID AS SourceModule, dbo.tglTransaction.TranDate, dbo.tglTransaction.TranNo, dbo.tglTransaction.glTranKey, dbo.tgl
    Transaction.TranKey, dbo.tglTransaction.TranType AS TranTypeNo, dbo.tciBatchLog.BatchKey, dbo.tglJournal.JrnlKey, dbo.tglAccount.GLAcctKey, dbo.tglAccount.CompanyID, dbo.vFormattedGLAcct.FormattedGLAcctNo, dbo.vFormattedGLAcct.Segment1, dbo.vFormattedGLAc
    ct.Segment1Desc, dbo.vFormattedGLAcct.Segment2, dbo.vFormattedGLAcct.Segment2Desc, dbo.vFormattedGLAcct.Segment3, dbo.vFormattedGLAcct.Segment3Desc, dbo.vFormattedGLAcct.Segment4, dbo.vFormattedGLAcct.Segment4Desc, dbo.vFormattedGLAcct.Segment5, dbo.vForm
    attedGLAcct.Segment5Desc, dbo.vFormattedGLAcct.Segment6, dbo.vFormattedGLAcct.Segment6Desc, dbo.vFormattedGLAcct.Segment7, dbo.vFormattedGLAcct.Segment7Desc, dbo.vFormattedGLAcct.Segment8, dbo.vFormattedGLAcct.Segment8Desc, dbo.vFormattedGLAcct.Segment9, 
    dbo.vFormattedGLAcct.Segment9Desc, dbo.vFormattedGLAcct.Segment10, dbo.vFormattedGLAcct.Segment10Desc, dbo.vFormattedGLAcct.Segment11, dbo.vFormattedGLAcct.Segment11Desc, dbo.vFormattedGLAcct.Segment12, dbo.vFormattedGLAcct.Segment12Desc, dbo.vFormattedGL
    Acct.Segment13, dbo.vFormattedGLAcct.Segment13Desc, dbo.vFormattedGLAcct.Segment14, dbo.vFormattedGLAcct.Segment14Desc, dbo.vFormattedGLAcct.Segment15, dbo.vFormattedGLAcct.Segment15Desc, dbo.tglAccount.Description AS GLAcctDesc, dbo.tglAccount.GLAcctNo, 
    dbo.tglFiscalPeriod.FiscPer, dbo.tglFiscalPeriod.FiscYear, dbo.tglFiscalPeriod.FiscYearPer, dbo.tsmLocalString.LocalText AS TranTypeDesc FROM dbo.tsmLocalString RIGHT OUTER JOIN dbo.tglJournal RIGHT OUTER JOIN dbo.vListValidationString INNER JOIN dbo.tglT
    ransaction ON dbo.vListValidationString.DBValue = dbo.tglTransaction.CreateType LEFT OUTER JOIN dbo.tglAccount LEFT OUTER JOIN dbo.tglFiscalPeriod ON dbo.tglAccount.CompanyID = dbo.tglFiscalPeriod.CompanyID ON dbo.tglTransaction.GLAcctKey = dbo.tglAccount
    .GLAcctKey AND dbo.tglTransaction.FiscPer = dbo.tglFiscalPeriod.FiscPer AND dbo.tglTransaction.FiscYear = dbo.tglFiscalPeriod.FiscYear LEFT OUTER JOIN dbo.tciTranType ON dbo.tglTransaction.TranType = dbo.tciTranType.TranType LEFT OUTER JOIN dbo.vFormatted
    GLAcct ON dbo.tglTransaction.GLAcctKey = dbo.vFormattedGLAcct.GLAcctKey ON dbo.tglJournal.JrnlKey = dbo.tglTransaction.JrnlKey ON dbo.tsmLocalString.StringNo = dbo.tciTranType.TranDescStrNo LEFT OUTER JOIN dbo.tciBatchLog ON dbo.tglTransaction.BatchKey = 
    dbo.tciBatchLog.BatchKey LEFT OUTER JOIN dbo.tsmModuleDef ON dbo.tglTransaction.SourceModuleNo = dbo.tsmModuleDef.ModuleNo LEFT OUTER JOIN dbo.tglAcctRef ON dbo.tglTransaction.AcctRefKey = dbo.tglAcctRef.AcctRefKey WHERE (dbo.vListValidationString.TableNa
    me = 'tglTransaction') AND (dbo.vListValidationString.ColumnName = 'CreateType')

  • 0 in reply to Contefication

    So far, the only way I can create this issue is by adding a column to vdvglAccountTran like:

    , dbo.tsmLocalString.LocalText AS TranTypeDesc
    , dbo.tciBatchLog.SourceCompanyID
    ,tapVoucher.VouchNo
    ,CONVERT(INT,dbo.tapVoucher.TranNo) 'Vend Invc No'

    If any code did this for tapVoucher.TranNo, tapVoucherLog.TranNo, or tglTransacion.TranNo, then the issue would popup similar to what  is reporting.  The reason I was requesting the script I mentioned previously was to enumerate all the fields in the view so I could verify that no such code was introduced.  tapVoucher.TranNo is the  "Invc No" field on the UI for the vendor invoice number in Enter Voucher.

    From the code, I would assume the join to tapVoucher was to expose the VouchNo which is a Sage 500 internal value as opposed to tapVoucher.TranNo which is a value external to Sage 500.  I can see why the user might want both, not realizing the in tglTransaction.TranNo for  AP vouchers is also the vendor invoice number.

    The tapVoucher reference was added for Sage 500 version 7.3 in 2009 as a work-around (40842) if that makes any difference.

Reply
  • 0 in reply to Contefication

    So far, the only way I can create this issue is by adding a column to vdvglAccountTran like:

    , dbo.tsmLocalString.LocalText AS TranTypeDesc
    , dbo.tciBatchLog.SourceCompanyID
    ,tapVoucher.VouchNo
    ,CONVERT(INT,dbo.tapVoucher.TranNo) 'Vend Invc No'

    If any code did this for tapVoucher.TranNo, tapVoucherLog.TranNo, or tglTransacion.TranNo, then the issue would popup similar to what  is reporting.  The reason I was requesting the script I mentioned previously was to enumerate all the fields in the view so I could verify that no such code was introduced.  tapVoucher.TranNo is the  "Invc No" field on the UI for the vendor invoice number in Enter Voucher.

    From the code, I would assume the join to tapVoucher was to expose the VouchNo which is a Sage 500 internal value as opposed to tapVoucher.TranNo which is a value external to Sage 500.  I can see why the user might want both, not realizing the in tglTransaction.TranNo for  AP vouchers is also the vendor invoice number.

    The tapVoucher reference was added for Sage 500 version 7.3 in 2009 as a work-around (40842) if that makes any difference.

Children
No Data