Removing Plant Data Associated with Part
You can remove single or multiple Plant Data objects associated with a Part object by providing the OIDs of the existing Part object and the Plant Data objects in the body of the request. You can specify the OID of any iteration/revision/view of a Plant Data object or its subtype in the body of the request. To remove a Plant Data object, you must have Modify permissions to the Plant Data object or its subtype.
|
• You cannot delete a Plant Data object. Plant Data objects are deleted automatically when they do not have an associated Part object.
• If you specify an invalid object in the request body, then the request fails and returns an error.
|
Example: Removing a Plant Data Object Associated with a Part Object
This example shows you how to remove a Plant Data object associated with a Part object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/RemovePlantDataAssociations
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PartPlantDataAssociations": [
{
"Part": {
"ID": "OR:wt.part.WTPart:112477"
},
"Plants": [
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:200077"
}
]
}
]
}
Example: Removing Multiple Plant Data Objects Associated with a Part Object
This example shows you how to remove two Plant Data objects associated with a Part object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/RemovePlantDataAssociations
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PartPlantDataAssociations": [
{
"Part": {
"ID": "OR:wt.part.WTPart:112477"
},
"Plants": [
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:202010"
},
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:202032"
}
]
}
]
}
Example: Removing Multiple Plant Data Objects Associated with Each Part Object
This example shows you how to remove multiple Plant Data objects associated with each of the Part objects specified in the request body. In this example, the request removes the Plant Data objects associated with each of the two Parts objects. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/RemovePlantDataAssociations
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PartPlantDataAssociations": [
{
"Part": {
"ID": "OR:wt.part.WTPart:112477"
},
"Plants": [
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:202102"
},
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:202122"
}
]
},
{
"Part": {
"ID": "OR:wt.part.WTPart:112633"
},
"Plants": [
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:202061"
},
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:202082"
}
]
}
]
}