Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Version: Windchill 13.0
Use Case: To get list of parts based on custom attribute, For ex : Type : WTPart Attribute Name : Model Values : "PC00123", "PC00456"
Description:
Need to fetch list of part using custom attributes(IBA), tried below solution but didn't work.
URL :
/Windchill/servlet/odata/ProdMgmt/Parts?$filter=startswith(Number,'P91-') and contains(Model,'PC00456')
Error : The property 'Model', used in a query expression, is not defined in type 'PTC.ProdMgmt.Part'
Note : "Model" is internal name of attribute.
Please let me know if you need anything and do you have any solution on this.
Thanks.
Solved! Go to Solution.
/Windchill/servlet/odata/v6/ProdMgmt/Parts/PTC.ProdMgmt.com.lt.bom_part?$filter=startswith(Number,'P91-') and contains(Model,'PC00456')
ETA: works if underscore is removed from internal type name
Windchill/servlet/odata/v7/ProdMgmt/Parts?$filter=startswith(Number,'P91') and contains(PTC.ProdMgmt.<internal name of part type>/Model,'PC00456')&$count=false
Need to include the internal name of part type which defines 'Model' attribute
Hi @rhart
Thanks for quick response,
Added internal name of part type which defines 'Model' attribute
PTC.ProdMgmt.com.lt.bom_part/Model
but still getting error as below :
{
"error": {
"code": null,
"message": "The URI is malformed."
}
}
Let me know if anything is missing.
thanks.
Error says "The URI is malformed." so perhaps you should show the URI and then someone might have another idea what the reason could be.
Below url used :
/Windchill/servlet/odata/v6/ProdMgmt/Parts?$filter=startswith(Number,'P91-') and contains(PTC.ProdMgmt.com.lt.bom_part/Model,'PC00456')
/Windchill/servlet/odata/v6 uri is malformed
/Windchill/servlet/odata/v7 working
ETA: need to remove the underscore from internal type name
for /v7 getting below error:
{
"error": {
"code": "REQUESTED_VERSION_NOT_FOUND",
"message": "Requested version is not found."
}
}
/Windchill/servlet/odata/v6/ProdMgmt/Parts/PTC.ProdMgmt.com.lt.bom_part?$filter=startswith(Number,'P91-') and contains(Model,'PC00456')
ETA: works if underscore is removed from internal type name
Hi @rhart
Its working as per below change in url
Changes :
1. after removed _ (underscore) from internal name
2. Instead of /v6/ used /v2/
Thank you very much for your support.
Thanks.