Unable to cast object of type 'Erp.Tablesets.InvcDtlTable' to type 'Ice.IceTable`1[Ice.Tablesets.QueryRelationRow]'

Hit the below error when want to assign legal number to AR Invoice. Please help.

Application Error

Exception caught in: Anonymously Hosted DynamicMethods Assembly

Error Detail

Message: Unable to cast object of type ‘Erp.Tablesets.InvcDtlTable’ to type ‘Ice.IceTable`1[Ice.Tablesets.QueryRelationRow]’.
Program: RefEmit_InMemoryManifestModule
Method: lambda_method

Client Stack Trace

at lambda_method(Closure , DataTable , IIceTable , Boolean )
at Ice.DatasetAdapter.Copy(DataSet sourceDataset, IceTableset destinationTableset, Boolean onlyChanges)
at Erp.Proxy.BO.ARInvoiceImpl.GetLegalNumGenOpts(ARInvoiceDataSet ds, Int32 ipInvoiceNum, Boolean& opPromptForNum)
at Erp.Adapters.ARInvoiceAdapter.GetLegalNumGenOpts(Int32 ipInvoiceNum, Boolean& opPromptForNum)

Did you ever figure out what it was?