Deleting Product Effectivities for an Effectivity-managed Part Object
You can delete existing single or multiple product Effectivities (Date, Lot, Block, and Unit (Serial)) for a part or its subtype. You can also delete the product effectivities with or without effectivity context.
When you delete multiple effectivities in a single transaction, the request succeeds only if all the effectivities can be deleted. If any of the effectivities are not deleted for any reason, then the entire transaction rolls back.
Example: Deleting All Types of Product Effectivities for a Part Object
This example shows you how to delete all types of product effectivities for a part object. This request deletes two Date effectivities, a Block effectivity, a Serial Number effectivity, and a Lot Number effectivity. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:275147')/PTC.ProdMgmt.RemoveEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Effectivity": [
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:278323"
},
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:278322"
},
{
"ID": "OR:wt.part.ProductBlockEffectivity:278321"
},
{
"ID": "OR:wt.part.ProductSerialNumberEffectivity:278320"
},
{
"ID": "OR:wt.part.ProductLotNumberEffectivity:278324"
}
]
}
Similarly, you can specify the OID of an Electrical part object in the request URI to delete effectivities associated with it.
Example: Deleting All Types of Product Effectivities for a Manufacturer Part Object
This example shows you how to delete all types of product effectivities for a Manufacturer part object. This request deletes two Date effectivities, a Block effectivity, a Serial Number effectivity, and a Lot Number effectivity. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/ManufacturerParts('OR:com.ptc.windchill.suma.part.ManufacturerPart:275598')/PTC.ProdMgmt.RemoveEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Effectivity": [
{
"ID": "OR:wt.part.ProductBlockEffectivity:275627"
},
{
"ID": "OR:wt.part.ProductLotNumberEffectivity:275631"
},
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:275630"
},
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:275629"
},
{
"ID": "OR:wt.part.ProductSerialNumberEffectivity:275628"
}
]
}
Example: Deleting All Types of Product Effectivities for a Vendor Part Object
This example shows you how to delete all types of product effectivities for a Vendor part object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/VendorParts('OR:com.ptc.windchill.suma.part.VendorPart:275676')/PTC.ProdMgmt.RemoveEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Effectivity": [
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:275707"
},
{
"ID": "OR:wt.part.ProductBlockEffectivity:275706"
},
{
"ID": "OR:wt.part.ProductSerialNumberEffectivity:275705"
},
{
"ID": "OR:wt.part.ProductLotNumberEffectivity:275709"
},
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:275708"
}
]
}
Example: Deleting a Product Effectivity for Supplier’s Manufacturer Part Object
This example shows you how to delete a product Date effectivity for a Supplier’s Manufacturer part object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/SupplierParts('OR:com.ptc.windchill.suma.part.ManufacturerPart:275598')/PTC.ProdMgmt.RemoveEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Effectivity": [
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:275711"
}
]
}
Similarly, you can delete other types of product effectivities for Supplier’s Manufacturer part object.
Example: Deleting a Product Effectivity for Supplier’s Vendor Part Object
This example shows you how to delete a product Date effectivity for a Supplier’s Vendor part object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/SupplierParts('OR:com.ptc.windchill.suma.part.VendorPart:275676')/PTC.ProdMgmt.RemoveEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Effectivity": [
{
"ID": "OR:wt.effectivity.WTDatedEffectivity:275713"
}
]
}
Similarly, you can delete other types of product effectivities for Supplier’s Vendor part object.
Example: Deleting a Product Effectivity for a Part Object
This example shows you how to delete a product Serial effectivity for a part object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:275147')/PTC.ProdMgmt.RemoveEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Effectivity": [
{
"ID": "OR:wt.part.ProductSerialNumberEffectivity:275705"
}
]
}
Similarly, you can delete other types of product effectivities for a part object.