New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OR-Filter on Property & NavigationProperty #1338
Comments
|
Hi @HeneryHawk , thanks for approaching us in this repo. I could reproduce this issue so I created a backlog item. Could you please share your time line and your project status? Best regards, |
|
Hi @jjtang1985, The feature that includes this functionality of the Cloud SDK should be delivered to our customers shortly. In a nutshell: Best |
|
Hi @HeneryHawk , thanks for sharing the status of your current project. @artemkovalyov , let's make a high priority for this. Best regards, |
|
Hi @HeneryHawk , sorry for the missing update here. The fix #1356 was merged 3 weeks ago and we released a new version 1.46.0. I'll close this ticket. |
|
Hi @jjtang1985, I have tested the new version, but I get the following error: .filter(or(Entity.ID.equals(id), Entity.EXTERNAL_IDS.filter(any(ExternalIds.EXTERNAL_ID.equals(id)))))If the filters are passed without the or-expression (generates an and expression by default), the generation of the filters works. Only if I want to link the two filters with an or-expression, I get this error. .filter(Entity.ID.equals(id), Entity.EXTERNAL_IDS.filter(any(ExternalIds.EXTERNAL_ID.equals(id))))The code compiles now, but causes a runtime error during execution. Regards PS: The filters.spec.ts only tests an and-expression of several filters. But in my case it is an or-expression. |
|
Hi @jjtang1985, can you please reopen this issue as I can't do that. Regards |
|
Hi @HeneryHawk , I'm sorry to hear the bug still exists. I reopened the ticket as I can reproduce the issue by using the following filter. or(
TestEntityV4.STRING_PROPERTY.equals('str'),
TestEntityV4.TO_MULTI_LINK.filter(
any(TestEntityMultiLinkV4.STRING_PROPERTY.equals('str2')
)
)To developers: we should add this case to the filter-factory. The ticket is on the top of our current sprint and will be treated as highest priority. |
|
Hi @HeneryHawk , the runtime error is fixed and please feel free to try the We might release a new stable version next week. Best regards, |
|
Hi @jjtang1985, I tested the fix with the Best regards, |
|
Ok, I'll close this issue then. |
Hi @jjtang1985
Creating a filter query consisting of two filters, one on an entity property and one filter on a NavigationProperty, which are associated with an OR expression, results in an error.
I want to create the following oData filter:
$filter=(Id eq <id> or (ExternalIds/any(a0:(a0/ExternalId eq '<id>'))))This should be done by the following code:
But unfortunately the TypeScript compiler returns the following error message:
However, linking both filters with an AND expression works fine
$filter=(Id eq <id> and (ExternalIds/any(a0:(a0/ExternalId eq '<id>'))))See also the question on the SAP Community.
Used Versions:
Regards
Simon
The text was updated successfully, but these errors were encountered: