Hello,
I have created a public data entity XXXCaseDetailAttachments with DocuRefEntity as main data source and CaseDetailBase table as child data source to enable access of attachment cases via OData.
I have tried to export via data management but I am having the following error:
Value cannot be null
Parameter name: location
It is not working via OData as well:
However, there are records in the data entity when doing a select in SQL:
Has anyone had this issue and if you could please help me out?
Thanks.
Hello,
I have found the issue. The method call postLoad in DocuRefEntity gets fileContents of the DocuRef record. The problem is that the database on the dev machine originates from another UAT environment and therefore attached files of the records are not found. The method call to retrieve the file contents generates an exception in such a case. I have implemented the logic within a try-catch to set the value of the fileContents to null in case of exception generated upon the method call to retrieve file contents.
Hello Martin,
Thanks for your build suggestion.
I think this is probably due to a build compilation issue as I have noticed an error stating 'Datasource CustInvoiceTrans_W is not found in view TaxTransDeclarationDetailsView'. I think that's what causing this error for the data entity. Weirdly enough, there is a method call to CustInvoiceTrans_W in the view but the datasource cannot be found in the designer view.
All right, we've solved nothing but we at least have an easier way to debug it.
I would recompile the package and synchronized DB once more before investigating it further.
Hello Bharani,
Yes, I have tried in SSMS and the records are the same.
Hello Martin,
It generates the same error as exception while executing the while statement:
Microsoft.Dynamics.Ax.Xpp.ClrErrorException at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue, interpret* ip) at Microsoft.Dynamics.Ax.MSIL.cqlCursorIL.NextRec(IntPtr table) at Microsoft.Dynamics.Ax.Xpp.Common.NextRec() at Dynamics.AX.Application.Test.`main(Args _args) in xppSource://Source/XXX\AxClass_Test.xpp:line 8 at Dynamics.AX.Application.Test.main(Args _args) at Test::Main(Object[] , Boolean& ) at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters) at Dynamics.AX.Application.SysClassRunnerHelper.`runMainMethod(SysClassRunnerState state) in xppSource://Source/ApplicationFoundation\AxClass_SysClassRunnerHelper.xpp:line 30 at Dynamics.AX.Application.SysClassRunnerHelper.runMainMethod(SysClassRunnerState state) at Dynamics.AX.Application.Forms.SysClassRunner.FormControl.timerControl.elapsed() in xppSource://Source/ApplicationFoundation\AxForm_SysClassRunner.xpp:line 52
Value cannot be null. Parameter name: location
Have you tried giving the same relation in SSMS? Is it returning all the required records?
I would try one more thing. What happens if you try to iterate records in a runnable class?
XXXCaseDetailAttachmentsEntity attachment; while select attachment { }
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156