Article - CS336660
ODATA: The filter AssociationType/Value eq 'OWNER' fails with "type PTC.CADDocumentMgmt.AssociationTypeEnum and EDM.String are not compatible" on WRS 2.1
Modified: 07-Feb-2022
Applies To
- Windchill PDMLink 11.1
Description
- How to filter in WRS using a enum?
- With WRS2.1, the following request fails:
-
$filter AssociationType/Value eq 'OWNER'
-
-
GET odata/v5/ProdMgmt/Parts('OR%3Awt.part.WTPart%3A5914167')/PartDocAssociations?%24filter=AssociationType%2FValue%20eq%20%20'OWNER'&%24count=false "code": null, "message": "The types 'PTC.CADDocumentMgmt.AssociationTypeEnum' and 'Edm.String' are not compatible." ERROR [ajp-nio-127.0.0.1-8010-exec-42] com.ptc.odata.windchill.servlet.WcRestServlet wcadmin - An unexpected REST error occured Incompatible types. at org.apache.olingo.server.core.uri.parser.ExpressionParser.checkEqualityTypes(ExpressionParser.java:1257) at org.apache.olingo.server.core.uri.parser.ExpressionParser.parseExprEquality(ExpressionParser.java:223) at org.apache.olingo.server.core.uri.parser.ExpressionParser.parseAnd(ExpressionParser.java:204) at org.apache.olingo.server.core.uri.parser.ExpressionParser.parseExpression(ExpressionParser.java:190) at org.apache.olingo.server.core.uri.parser.ExpressionParser.parse(ExpressionParser.java:184) at org.apache.olingo.server.core.uri.parser.FilterParser.parse(FilterParser.java:48) at org.apache.olingo.server.core.uri.parser.Parser.parseFilterOption(Parser.java:413)
This is a printer-friendly version of Article 336660 and may be out of date. For the latest version click CS336660