on 2021 Nov 08 11:09 AM
We have the following code where we are doing an expand. However when we try to do a search, system does not allow search (502 Bad Gateway). Is there a way to make a search in the expanded collection?
/sap/c4c/odata/v1/c4codataapi/ServiceRequestPartyCollection?$filter=PartyID eq '1234'&$expand=ServiceRequest&$search=Hello
Request clarification before answering.
Hi Kemal Atakan,
As mentioned by Fabien, substringof operator only works for properties having 1..1 cardinality. Furthermore, please note that there is no restriction in the number of times the substringof operator can be used in a single query. It just needs to be used with the right property (i.e. 1..1 cardinality).
I see two issues in your question;
Furthermore, in C4C OData API, you can use '*' asterisks as wildcard character in queries containing $filter (with eq operator) instead of the substringof operator. For example;
...ServiceRequest/Name eq '*fries*'...
Even the above approach only works for the properties with 1..1 cardinality.
Regards,
Mustafa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mustafa,
Thanks for the answers. It's good to know the limits 🙂
The case in our hands is that we have a customer portal and we'd like to display the tickets to anyone involved (anyone in the ServiceRequestParty).
Can we limit the search to a specific set of data? Let's say that from our first original request, we get a list of ticket IDs (100,101,102). Can we make the search request, only in ticket IDs 100,101,102? At least this is what I understand from ODATAAPIDEVGUIDE:
PS: c4codataapi'yi çok seviyoruz, destekleriniz için teşekkürler 🙂
Hi Mustafa,
In my testing it seems the wildcard operator only works when you use 'eq' not when you use 'ne', so for example
This filters the correct results:
...ServiceRequest/Name eq '*fries*'...
This does not (Entities with name 'french fries 1' would still show up):
...ServiceRequest/Name ne '*fries*'...
Can you maybe give me more info on that?
Kind regards,
Niklas
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.