SQL Error while opening Project management and accounting --> Project Invoices --> Project Invoices form

Object Server 01: The database reported (session 4 (SDHU89)): [Microsoft][SQL Server Native Client 11.0]Restricted data type attribute violation. The SQL statement was: “SELECT T1.PROJGROUPID,T1.ORDERACCOUNT,T1.INVOICEACCOUNT,T1.INVOICEDATE,T1.DUEDATE,T1.CASHDISC,T1.CASHDISCDATE,T1.COSTVALUE,T1.SUMLINEDISC,T1.SALESORDERBALANCE,T1.ENDDISC,T1.INVOICEAMOUNT,T1.CURRENCYID,T1.EXCHRATE,T1.PROJINVOICEID,T1.LEDGERVOUCHER,T1.ONACCOUNTAMOUNT,T1.TAXPRINTONINVOICE,T1.DELIVERYNAME,T1.ENTERPRISENUMBER,T1.DLVTERM,T1.DLVMODE,T1.PAYMENT,T1.CASHDISCCODE,T1.INVOICEROUNDOFF,T1.CASHDISCPERCENT,T1.TAXGROUPID,T1.TAXSPECIFYTOTAL,T1.TAXSPECIFYBYLINE,T1.PAYMENTSCHED,T1.SUMTAX,T1.PROPOSALID,T1.POSTINGPROFILE,T1.PROJINVOICEPROJID,T1.PARMID,T1.INTRASTATDISPATCHID,T1.LISTCODEID,T1.PROJINVOICETYPE,T1.TRIANGULATION,T1.EXCHRATESECONDARY,T1.PORT,T1.WEIGHT,T1.VOLUME,T1.QTY,T1.VATNUM,T1.LANGUAGEID,T1.PAYMDAYID,T1.EUSALESLIST,T1.SUMMARKUP,T1.NUMBERSEQUENCEGROUPID,T1.POSTINGJOURNALID,T1.EINVOICELINESPECIFIC,T1.SMASPECINDEXCALC,T1.GIROTYPE,T1.EINVOICEACCOUNTCODE,T1.INTERCOMPANYPOSTED,T1.PAYMID,T1.PRINTEDORIGINALS,T1.DELIVERYPOSTALADDRESS,T1.DEFAULTDIMENSION,T1.VOUCHERNUMBERSEQUENCETABLE,T1.SOURCEDOCUMENTHEADER,T1.INVOICENUMBERINGCODE_LT,T1.INVOICEREGISTER_LT,T1.WHOISAUTHOR_LT,T1.INVOICESTATUS_LT,T1.SALESDATE_CZ,T1.DESCRIPTION,T1.DOCUMENTDATE_W,T1.INTRASTATADDVALUE_LV,T1.PSAENDDATEMAXINVOICEID,T1.DIRECTDEBITMANDATE,T1.NARRATION_BR,T1.PSAINVOICEFORMATS,T1.REASONTABLEREF,T1.TAXINFORMATION_IN,T1.TRANSPORTATIONDOCUMENT,T1.INVOICETYPE_MY,T1.TIDCOSTBREAKDOWNISCREATED,T1.TIDFAKTURPAJAKADJUSTED,T1.TIDFAKTURPAJAKADJUSTEXCHDATE,T1.TIDFAKTURPAJAKADJUSTEXCHRATE,T1.TIDFAKTURPAJAKADJUSTJOURNALNUM,T1.TIDFAKTURPAJAKADJUSTSUMTAXMST,T1.TIDFAKTURPAJAKID,T1.TIDFAKTURPAJAKLISTID,T1.TIDFAKTURPAJAKPERSONID,T1.TIDFAKTURPAJAKPOSTED,T1.TIDFAKTURPAJAKPOSTEDDATE,T1.TIDFAKTURPAJAKSTATUS,T1.TIDNOTARETURID,T1.TIDREFCOSTBREAKDOWNJOURNALNUM,T1.TIDREFREVBREAKDOWNJOURNALNUM,T1.TIDREVBREAKDOWNISCREATED,T1.DATAAREAID,T1.RECVERSION,T1.PARTITION,T1.RECID FROM PROJINVOICEJOUR T1 WHERE ((PARTITION=?) AND (DATAAREAID IN (?) )) ORDER BY T1.INVOICEDATE DESC OPTION(FAST 14)”

I think error is due to corrupt data, but not able to find out the exact cause…

Does it happen every time? Do you have the same problem with any other table? Does it happen too if you open ProjInvoiceJour table in table browser?
What happened with your system before you got this error for the first time?

Yes every time when I open that form. Previously system was giving error while opening ProjInvoiceJour table directly from AOT , if i open with table browser no error. I changed the status for one of the record in source document line from none to completed. After that it is allowing me to open the ProjInvoiceJour table directly from AOT. But not the ProjInvoices form.

sorry i changed the record SourceDocument header table

its wiered, now again it gives same error when i open table directly from aot too.