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!

  • 0

    What version and update?

    The base view should be vdvglAccountTran, so you can try querying the view from the back-end to determine what it shows. You should also verify you don't have any customizations to the view or schema that might be affecting the results. Also, make sure you are working with the default view by checking it from Explore, File, Properties.

    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.vListValidationString.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.PostAmt, 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.tglTransaction.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.vFormattedGLAcct.Segment1Desc, dbo.vFormattedGLAcct.Segment2, dbo.vFormattedGLAcct.Segment2Desc, 
                          dbo.vFormattedGLAcct.Segment3, dbo.vFormattedGLAcct.Segment3Desc, dbo.vFormattedGLAcct.Segment4, dbo.vFormattedGLAcct.Segment4Desc, 
                          dbo.vFormattedGLAcct.Segment5, dbo.vFormattedGLAcct.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.vFormattedGLAcct.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, 
                          dbo.tciBatchLog.SourceCompanyID,tapVoucher.VouchNo
    FROM         dbo.tsmLocalString RIGHT OUTER JOIN
                          dbo.tglJournal RIGHT OUTER JOIN
                          dbo.vListValidationString INNER JOIN
                          dbo.tglTransaction 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.vFormattedGLAcct 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
             				LEFT OUTER JOIN dbo.tapVoucher ON dbo.tglTransaction.TranKey = dbo.tapVoucher.VoucherKey AND  
                         			dbo.tglTransaction.BatchKey = dbo.tapVoucher.BatchKey
    WHERE     (dbo.vListValidationString.TableName = 'tglTransaction') AND (dbo.vListValidationString.ColumnName = 'CreateType')

  • 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 Contefication

    Appreciate the response. I did check the properties, and it matches your screen shot. Looking into querying the database but don't have direct access. 

  • 0 in reply to M_DeMateo

    This appears to be a bug that stems from the addition of the tapVoucher table to the base view by Sage in the 7.2-7.4 version timeframe, so it's been there a while. The join is not valid and the problem is probably being exposed because you are posting to GL in detail from AP and/or using inter-company features.

    I would suggest you remove the Voucher Number column in your Explorer settings (individual to you). You should delete any filters you have on Voucher Number, then from the menu select Tools, Edit Columns (the F3 function button or Alt-F3 work as well). In the Edit Columns dialogue, deselect "Voucher Number", then click OK.

    This removes the Voucher Number column from your Explorer display. Test your scenario again and see what happens. There is also a Src Module issue with some versions of the view (we still don't know your version), which is what I think Ramon might be referencing, so remove that from Explorer as well.

  • 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

    Version: 

    Tried removing the Voucher Number column, but it doesn't seem to make a difference either way

  • 0 in reply to M_DeMateo

    If it isn't a modification to the view, it might be something introduced or a piece of data that is missing from your AP activation. If you have the SOA demo company on your system, you can logon to it and try the Explorer within the context of the demo data. That will potentially narrow down the cause but ultimately you may need to be granted direct access to the database, work with someone who has that access and/or contact your Sage 500 reseller, consultant or Support.

  • 0 in reply to Contefication

    Thank you for your help, much appreciated!

  • 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.