Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Would like to obtain WTDocuments with name "Test Data" from either Reference By or Describe By link from Parts.
I was able to use the endpoint getPartsInPartsByID and supply it with value "References" in expand and was able to generate at least the Link OID. But the link oid doesn't offer name of document linked to so would I have to create another service that takes in the link value, gets the doc referenced and get its name? or could this be done in select or via expand parameter?
Here is my current service code :
// result: JSON
var partLinks = me.getPartsByID({
$expand: "References" /* STRING */,
ID: ID/* STRING */,
$select: undefined /* STRING */
});
var references = partLinks.References;
var result = "{ \"TestDataIDs\": [";
for ( var i=0; i < references.length ; i++) {
result += "\"" + references[i].ID + "\"";
if (i != (references.length - 1)) {
result += ",";
}
}
result +="]}";