Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC BOM Transformation Domain > Removing Multiple Secondary Co-produce Associations
  
Removing Multiple Secondary Co-produce Associations
A secondary co-produce association (Secondary Co-produce Link) exists between a revision of Co-produce object and the main secondary part associated with it.
To remove single or multiple secondary parts associated with a Co-produce object, you must first check out the Co-produce object. You can remove single or multiple secondary parts associated with a Co-produce object by specifying the Co-produce OID and the secondary part OIDs in the request body.
You must have Modify permissions to the secondary parts and to the Co-produce object for which you want to remove the secondary parts.
* 
When you remove a Secondary Co-produce Link, only the link between the specified revision of the Co-produce object and the specified secondary part is removed.
The Secondary Co-produce Links between other revisions of the same Co-produce object and the same secondary parts are not removed.
The Co-produce object is not iterated when the associated secondary part is removed.
When a secondary part is removed, the structure of the specified Co-produce object is regenerated using the specified navigation criteria.
You can also choose to remove the secondary parts in the context of Change (change task or change notice). You must first reserve the Change object for Edit. You must have Modify permissions to the Change object and Manufacturing History objects.
* 
When the Track “Made From” History Through Change Notice preference is set to Yes, you must specify the ChangeOid attribute and its value.
When the preference is set to Yes, Manufacturing History Objects are added in the UI in the Resulting Objects table of the Change object specified in the ChangeOid attribute value.
Example: Removing Multiple Secondary Parts for a Co-produce Object for a Specific Navigation Criteria
This example shows you how to remove two secondary parts associated with a Co-produce object for a specific navigation criteria. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/RemoveCoproduceMembers
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CoproduceSecondaryMembersAssociations": [
{
"Coproduce": {
"ID": "OR:wt.part.WTPart:202117"
},
"SecondaryMembers": [
{
"ID": "OR:wt.part.WTPart:202064"
},
{
"ID": "OR:wt.part.WTPart:202080"
}
]
}
],
"navigationCriteriaId": "OR:wt.filter.NavigationCriteria:331152"
}
Example: Removing Multiple Secondary Parts for a Co-produce Object with Inline Navigation Criteria
This example shows you how to remove two secondary parts associated with a Co-produce object with inline navigation criteria. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/RemoveCoproduceMembersWithInlineNavCriteria
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CoproduceSecondaryMembersAssociations": [
{
"Coproduce": {
"ID": "OR:wt.part.WTPart:202117"
},
"SecondaryMembers": [
{
"ID": "OR:wt.part.WTPart:202064"
},
{
"ID": "OR:wt.part.WTPart:202080"
}
]
}
],
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"ApplicationName": null,
"ApplyToTopLevelObject": false,
"Centricity": false,
"ConfigSpecs": [
{
"@odata.type": "#PTC.NavCriteria.WTPartEffectivityDateConfigSpec",
"EffectiveDate": "2022-03-15T23:00:00Z",
"EffectiveContext": "wt.part.WTPartMaster:194861",
"View": "Design",
"Variation1": null,
"Variation2": null
}
],
"CreatedOn": "2022-03-22T00:25:50+01:00",
"Filters": [],
"HideUnresolvedDependents": false,
"LastModified": "2022-03-22T00:25:50+01:00",
"Name": "Filter1",
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
}
Example: Removing Multiple Secondary Co-produce Links for a Specific Navigation Criteria and with “ChangeOid” Specified
This example shows you how to remove two Secondary Co-produce Links for a Co-produce object for a specific navigation criteria in the context of Change. In this example, the Track “Made From” History Through Change Notice preference is set to Yes. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/RemoveCoproduceMembers
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"CoproduceSecondaryMembersAssociations": [
{
"Coproduce": {
"ID": "OR:wt.part.WTPart:202117"
},
"SecondaryMembers": [
{
"ID": "OR:wt.part.WTPart:202064"
},
{
"ID": "OR:wt.part.WTPart:202080"
}
]
}
],
"navigationCriteriaId": "OR:wt.filter.NavigationCriteria:331152",
"ChangeOid": "VR:wt.change2.WTChangeOrder2:210474"
}
The request adds the regenerated Co-produce object and the Manufacturing History objects in the Resulting Objects table of the Change object specified in ChangeOid.