Hi There,
I am trying to run a REST query to retrieves some fields at AR Line Level (coming from ARTran) with a couple of fields coming from the ARInvoice header table.
If I start just with the AR Tran part, I have this:
/ODatav4/PX_Objects_AR_ARTran?$select=RefNbr,LineNbr&$filter=RefNbr eq 'AR012031'
which works fine.
I then try to add the expand clause to pull in the related information from AR Invoice. This gets me this:
/ODatav4/PX_Objects_AR_ARTran?$select=RefNbr,LineNbr&$filter=RefNbr eq 'AR012031'&$expand=ARInvoiceByRefNbr
which also works fine.
However - lets say I only want to see the InvoiceDate - I add a select giving me this:
/ODatav4/PX_Objects_AR_ARTran?$select=RefNbr,LineNbr&$filter=RefNbr eq 'AR012031'&$expand=ARInvoiceByRefNbr($select=InvoiceDate)
BANG!
And this rather exciting error message that I can’t make head nor tail of.
"innererror": {
"message": "Column DocType is not found in DAC ARRegister. ",
"type": "PX.Data.PXNotSupportedException",
"stacktrace": " at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.VisitSubQueryProperty(SubQuery subQuery, Type dac, Type propertyType, String propertyName)\r\n at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.VisitMember(MemberExpression expression)\r\n at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)\r\n at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.Visit(Expression expression)\r\n at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.VisitMemberInit
etc
Any ideas?
Thanks in adavnce.
PS: Doing the same thing over SalesLines - and linking back to the header as below:
/ODatav4/PX_Objects_SO_SOLine?$select=OrderNbr,OrderDate&$filter=OrderNbr eq 'SO004375'&$expand=SOOrderByOrderNbr($select=CustomerOrderNbr)
works.
Is it possible there’s an underlying error in the join definition server side?