
$crossjoin
capabilities by separatingFunctionImport
in the following way:<FunctionImport Name="QueryService_PostQuery" ReturnType="Edm.String" m:HttpMethod="POST">
<Parameter Name="QueryOption" Type="Edm.String"/>
<Parameter Name="QueryPath" Type="Edm.String"/>
</FunctionImport>
POST /b1s/v1/QueryService_PostQuery
{
"QueryPath": "$crossjoin(Orders,Orders/DocumentLines)",
"QueryOption": "$expand=Orders($select=DocEntry, DocNum),Orders/DocumentLines($select=ItemCode,LineNum)&$filter=Orders/DocEntry eq Orders/DocumentLines/DocEntry and Orders/DocEntry ge 3 and Orders/DocumentLines/LineNum eq 0"
}
{
"odata.metadata" : "$metadata#Collection(Edm.ComplexType)",
"value" : [
{
"Orders" : {
"DocEntry" : 9,
"DocNum" : 5
},
"Orders/DocumentLines" : {
"ItemCode" : "i1",
"LineNum" : 0
}
},
{
"Orders" : {
"DocEntry" : 12,
"DocNum" : 6
},
"Orders/DocumentLines" : {
"ItemCode" : "i1",
"LineNum" : 0
}
},
...
{
"Orders" : {
"DocEntry" : 20,
"DocNum" : 12
},
"Orders/DocumentLines" : {
"ItemCode" : "i1",
"LineNum" : 0
}
},
{
"Orders" : {
"DocEntry" : 44,
"DocNum" : 22
},
"Orders/DocumentLines" : {
"ItemCode" : "i1",
"LineNum" : 0
}
}
]
}
POST /b1s/v1/QueryService_PostQuery
{
"QueryPath":"$crossjoin(Orders,Orders/DocumentLines)",
"QueryOption":"$expand=Orders($select=DocEntry, DocNum),Orders/DocumentLines($select=ItemCode,LineNum)&$filter=Orders/DocEntry eq Orders/DocumentLines/DocEntry and (Orders/DocumentLines/LineNum eq 0 or Orders/DocumentLines/LineNum eq 1 or Orders/DocumentLines/LineNum eq 2)"
}
{
"odata.metadata" : "$metadata#Collection(Edm.ComplexType)",
"value" : [
{
"Orders" : {
"DocEntry" : 9,
"DocNum" : 5
},
"Orders/DocumentLines" : {
"ItemCode" : "i1",
"LineNum" : 0
}
},
{
"Orders" : {
"DocEntry" : 3,
"DocNum" : 1
},
"Orders/DocumentLines" : {
"ItemCode" : "i1",
"LineNum" : 0
}
},
...
{
"Orders" : {
"DocEntry" : 28,
"DocNum" : 17
},
"Orders/DocumentLines" : {
"ItemCode" : "i2",
"LineNum" : 1
}
},
{
"Orders" : {
"DocEntry" : 44,
"DocNum" : 22
},
"Orders/DocumentLines" : {
"ItemCode" : "i2",
"LineNum" : 1
}
}
]
}
text/plain
.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
9 | |
8 | |
4 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 |