09-08-2022 10:57 AM
This oData query to ServiceRequestServiceReferenceObjectCollection:
https://my.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ServiceRequestServiceReferenceObjectCollect... eq 'SERIALID'&$select=ObjectID,InstallationPointID&$format=json
gives me two entities:
{
"d": {
"results": [
{
"ObjectID": "025B31541C561EDD8AA312A531497E8C",
"InstallationPointID": "4047"
},
{
"ObjectID": "06A84A6744FC1EDD8BEB170B54B85066",
"InstallationPointID": "4047"
}
]
}
}
So, this query should work: (filter by InstallationPointID eq '4047')
https://my.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ServiceRequestServiceReferenceObjectCollect... eq '4047'&$select=ObjectID,Inst
allationPointID&$format=json
but it doesn't, I get response with code 200 and empty results:
{
"d": {
"results": []
}
}
This entity field is marked as filterable in $metadata:
<EntityType Name="ServiceRequestServiceReferenceObject" c4c:parent-entity-type="ServiceRequest">
<Key>
<PropertyRef Name="ObjectID"/>
</Key>
<Property Name="ObjectID" Type="Edm.String" Nullable="false" MaxLength="70" FixedLength="true" sap:creatable="false" sap:updatable="false" sap:filterable="true"/>
<Property Name="InstallationPointID" Type="Edm.String" Nullable="true" MaxLength="40" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<NavigationProperty Name="ServiceRequest" Relationship="c4codata.ServiceRequest_ServiceRequestServiceReferenceObject" FromRole="ServiceRequestServiceReferenceObject" ToRole="ServiceRequest"/>
</EntityType>