Skip to main content
avillanueva
23-Emerald I
23-Emerald I
August 11, 2025
Solved

Getting IBA value on a Product Container when calling PTC.DataAdmin.ProductContainer

  • August 11, 2025
  • 1 reply
  • 1714 views

We just upgraded my environment from WC 12 to WC 13 and Thingworx Navigate from 9.3 to 9.7. We had some custom apps developed which do some number assignment. I am getting an error in some services and I think its because its not grabbing the instance based attribute we added to the Product Container. In my Windchill system, we have added an attribute called PID:

avillanueva_0-1754912766126.png

In Thingworx, there is a service that calls to get all the product container by PID which calls another service to get all the containers:

// result: JSON
var product = me.getProductContainers({
	$filter: "PID eq '"+pid+"'" /* STRING */,
	$select: undefined /* STRING */,
	count: undefined /* BOOLEAN */
});

var result;
if (product.value[0]) {
 result = product.value[0].ID;
}

Logs of another service show this: 

Execution error in service script [GenerateNewDocumentNumbers] :: Your route exchange has failed. Service operation failed with status [ - The property 'PID', used in a query expression, is not defined in type 'PTC.DataAdmin.ProductContainer'.]

avillanueva_1-1754912944618.png

The resulting JSON elements show this (redacted)

"value": [
 {
 "LastModified": "2023-11-17T07:32:48-05:00",
 "CreatedBy": "Antonio Villanueva",
 "Description": "Program description",
 "@odata.type": "#PTC.DataAdmin.ProductContainer",
 "PrivateAccess": false,
 "CreatedOn": "2004-06-30T09:35:30-04:00",
 "ID": "OR:wt.pdmlink.PDMLinkProduct:922685",
 "OrganizationID": {
 "UniqueIdentifier": "XXXXX",
 "CodingSystem": "CAGE Code"
 },
 "Name": "Program Name"
 },

Noting there is no call out for the attributes which I assume why its complaining about PID not being found right?

Best answer by avillanueva

I was able to get the answer from my sister company. We had work done by a VAR and this appears to be an undocumented customization that was missed in my source control. The codebase/rest/ptc/domain/DataAdmin/v5/entity/ProductContainers.json was modified to add two attributes. Chalk this up to the Ron Popeil error.

 

avillanueva_3-1754998008295.png

{
 "name":"ProductContainer",
 "collectionName":"ProductContainers",
 "wcType":"wt.pdmlink.PDMLinkProduct",
 "description":"This product extends Container entity",
 "attributes":[
 {
 "name": "PID",
 "internalName": "PID",
 "type": "String"
 },
 {
 "name": "PrimarySite",
 "internalName": "Site",
 "type": "String"
 },
 ],
 "parent":{
 "name":"Containers"
 },
 "inherits":[
 {
 "name":"optionPoolable"
 },
 {
 "name":"optionSetAssignable"
 }
 ],
 "navigations":[]
}

 

 

 

 

 

 

1 reply

18-Opal
August 11, 2025

I'm sorry for asking, but are you sure you defined it on the Product directly, and not on one of subtypes?

avillanueva
23-Emerald I
23-Emerald I
August 11, 2025

Its defined on wt.pdmlink.PDMLinkProduct directly. I did come across this but it worked in our previous version so I am confused. 

https://www.ptc.com/en/support/article/CS438785?source=search

 

18-Opal
August 11, 2025

Ah ok, seems like one of those cases when you need to contact Support...

 

Another naive idea -- maybe try to downgrade the API level? I see that you don't specify the version in your route, which means it takes the latest (I'm getting v7 on my 13.0.2). Try to specify v6 or older explicitly and see if that helps.

 

/ Constantine