Unable to get the Order and Order entry details using flex query

Viewed 1337

I am using below flexible search query to get the order and order entry details from Hybris (version1808)

select {o.code},{o.date},{o.date},{o.totalprice},{o.totalTAX}, {ev.code} from {
Order as o
JOIN OrderEntry as oe ON {oe.orderpk} = {o.PK}
JOIN  EnumerationValue as ev on {o.status}={ev.pk}
JOIN Product as p ON {oe.productpk} = {p.PK}
}
where {o.versionID} is NULL 

I am getting below error

cannot search unknown field 'TableField(name='orderpk',langPK='null',type=OrderEntry)' within type OrderEntry unless you disable checking

Is there anything that I am missing?

1 Answers

Change {oe.orderpk} to {oe.order} and {oe.productpk} to {oe.product}

SELECT {o.code},{o.date},{o.date},{o.totalprice},{o.totalTAX}, {ev.code} from {Order as o
JOIN OrderEntry as oe ON {oe.order} = {o.PK}
JOIN  EnumerationValue as ev on {o.status}={ev.pk}
JOIN Product as p ON {oe.product} = {p.PK}
}
where {o.versionID} is NULL
Related