Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Voucher Transaction error: '', hexadecimal value 0x02, is an invalid character

Posted on by 2,135

We are getting this error when trying to run the Voucher Transaction inquiry in AX General Ledger module.  Not sure which GL transactions is causing it.  Any help would be appreciated.

  • Tremor Olaes Profile Picture
    Tremor Olaes 2,135 on at
    RE: Voucher Transaction error: '', hexadecimal value 0x02, is an invalid character

    I want to also add that you need to synchronize the GENERALJOURNALACCOUNTENTRY table in AOT.

  • Verified answer
    Tremor Olaes Profile Picture
    Tremor Olaes 2,135 on at
    RE: Voucher Transaction error: '', hexadecimal value 0x02, is an invalid character

    Hi guys, 

    I figured out how to fix this issue:  Sharing script I used to find the culprit:

    select

    gje.SUBLEDGERVOUCHER "Voucher",
    gje.ACCOUNTINGDATE,
    m.MAINACCOUNTID "Account",
    m.NAME "AccountName",
    gjae.TEXT as Description,CHARINDEX(0x02, CAST(TEXT AS varbinary(30))) Position,
    gjae.*
    from GENERALJOURNALENTRY gje
    inner join ledger com on gje.LEDGER = com.RECID --and gje.[PARTITION] = com.[PARTITION]
    inner join GENERALJOURNALACCOUNTENTRY gjae on gje.RECID = gjae.GENERALJOURNALENTRY --and gje.[PARTITION] = gjae.[PARTITION]
    inner join DIMENSIONATTRIBUTEVALUECOMBINATION davc on gjae.LEDGERDIMENSION = davc.RECID --and gje.[PARTITION] = davc.[PARTITION]
    inner join MAINACCOUNT m on davc.MAINACCOUNT = m.RECID --and davc.[PARTITION] = m.[PARTITION]
    inner join [FISCALCALENDARPERIOD] FCP ON gje.[FISCALCALENDARPERIOD] = FCP.[RECID] --and gje.[PARTITION] = FCP.[PARTITION]
    inner join [FISCALCALENDARYEAR] FCY ON gje.FISCALCALENDARYEAR = FCY.RECID and gje.[PARTITION] = FCY.[PARTITION] -- AND FCY.FISCALCALENDAR = FCP.FISCALCALENDAR
    left join MainAccountCategory mc ON mc.ACCOUNTCATEGORYREF = m.ACCOUNTCATEGORYREF --and mc.[PARTITION] = m.[PARTITION]
    left join DIMENSIONATTRIBUTELEVELVALUEVIEW dalvd on davc.recid= dalvd.VALUECOMBINATIONRECID and dalvd.DIMENSIONATTRIBUTE = 5637144826
    left join [DIMENSIONATTRIBUTEVALUE] dav on dav.DIMENSIONATTRIBUTE = dalvd.DIMENSIONATTRIBUTE and dav.ENTITYINSTANCE = dalvd.ENTITYINSTANCE
    left join [DIMATTRIBUTEOMDEPARTMENT] daod on -- dalvd.DISPLAYVALUE = daod.VALUE
    daod.[KEY_] = dav.ENTITYINSTANCE
    left join DIMENSIONATTRIBUTELEVELVALUEVIEW dalvf on davc.recid= dalvf.VALUECOMBINATIONRECID and dalvf.DIMENSIONATTRIBUTE = 5637145326
    left join [DIMATTRTRANSLFINANCIALTAG] daftf on dalvf.DISPLAYVALUE = daftf.VALUE and daftf.CATEGORY = 5637145076 and daftf.LANGUAGEID = 'en-us'
    left join DIMENSIONATTRIBUTELEVELVALUEVIEW dalvp on davc.recid= dalvp.VALUECOMBINATIONRECID and dalvp.DIMENSIONATTRIBUTE = 5637145327
    left join [DIMATTRTRANSLFINANCIALTAG] daftp on dalvp.DISPLAYVALUE = daftp.VALUE and daftp.CATEGORY = 5637145077 and daftp.LANGUAGEID = 'en-us'
    left join DIMENSIONATTRIBUTELEVELVALUEVIEW dalve on davc.recid= dalve.VALUECOMBINATIONRECID and dalve.DIMENSIONATTRIBUTE = 5637145576
    left join SRSANALYSISENUMS enumLPT ON enumLPT.ENUMNAME = 'LedgerPostingType' AND enumLPT.ENUMITEMVALUE = gjae.POSTINGTYPE
    left join subledgerVoucherGeneralJournalEntry svgje ON svgje.GENERALJOURNALENTRY = gje.RECID AND svgje.VOUCHERDATAAREAID = gje.SUBLEDGERVOUCHERDATAAREAID AND svgje.VOUCHER = gje.SUBLEDGERVOUCHER
    where
    gje.ACCOUNTINGDATE BETWEEN '08/01/2020' AND '12/31/2020'
    and com.NAME in ('ENTW')
    and CHARINDEX(0x02, CAST(TEXT AS varbinary(30))) > 0

    order by com.NAME, gje.ACCOUNTINGDATE, FCP.TYPE, gje.JOURNALNUMBER

    This is the script I wrote to fix the issue:

    update GENERALJOURNALACCOUNTENTRY
    set [text] = REPLACE([text], CHAR(2) , '')
    where recid in ( <recid>)

    I tested this and it works.

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Voucher Transaction error: '', hexadecimal value 0x02, is an invalid character

    I suspect it's a problem in data; somebody pasted text containing this character, which may cause issues when trying to use it in XML, for example.

    If you know which field it is about, it's possible to use SQL to find the problematic row in the table. If you have no idea about the culprit, debugging may be the way forward.

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Voucher Transaction error: '', hexadecimal value 0x02, is an invalid character

    Hi Tremor,

    That seems to be a technical issue possibly because something has been adjusted/modified in your machine.

    Do you have a developer around who could help getting this fixed?

    Best regards,

    Ludwig

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans