Updating Primary Co-produce Links
The primary co-produce link exists between a primary part version and the main part of co-produce objects.
You can update single or multiple primary co-produce links for a primary part by specifying the link OIDs and their attributes in the request body. You can also update the AlternateNumber attribute for the specified primary co-produce link. You cannot specify the alternate number that is already consumed by another co-produce object available for the corresponding plant for the same primary part. If you do not specify the attribute, the existing alternate number is used while updating the specified primary co-produce link.
You can update both modeled and all other types of attributes associated with the link object.
You can also update single or multiple primary co-produce links for a part object in the context of change (change task or change notice). You must first reserve the change object for Edit.
This bounded action is available for part or its subtype (excluding Manufacturing Information and Resources) objects only when Windchill MPMLink is installed.
* 
You must provide a Made From Set OID to update the Made From Set reference on the primary co-produce links.
The Made From Set OID must belong to the primary part for which you want to update the primary co-produce link.
Example: Updating Multiple Primary Co-produce Links in Context of Change with Inline Navigation Criteria
This example shows you how to update two primary co-produce links for the specified primary part in the context of change with inline navigation criteria applied. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:204541')/PTC.ProdMgmt.UpdatePrimaryCoproduceLinks
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PrimaryCoproduceLinks": [
{
"ID": "OR:wt.mpm.coproduce.PrimaryCoproduceLink:205707",
"CustomAttribute1": 8,
"TestAttribute": "Test1",
"Quantity": 79,
"Unit": {
"Value": "ea",
"Display": "each"
},
"[email protected]": "Parts('OR:wt.part.WTPart:205405')",
"[email protected]": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:206572')"
]
},
{
"ID": "OR:wt.mpm.coproduce.PrimaryCoproduceLink:205709",
"Quantity": 8890,
"Unit": {
"Value": "2",
"Display": "each"
},
"[email protected]": "Parts('OR:wt.part.WTPart:205405')",
"[email protected]": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:206572')"
]
}
],
"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,
"ID": "OR:wt.filter.NavigationCriteria:207141",
"LastModified": "2022-03-22T00:25:50+01:00",
"Name": "filter",
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
}
Example: Updating Multiple Primary Co-produce Links in Context of Change for a Specific Navigation Criteria
This example shows you how to update two primary co-produce links for the specified primary part in the context of change and for a specific navigation criteria. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:204541')/PTC.ProdMgmt.UpdatePrimaryCoproduceLinks
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PrimaryCoproduceLinks": [
{
"ID": "OR:wt.mpm.coproduce.PrimaryCoproduceLink:205707",
"Quantity": 79,
"Unit": {
"Value": "ea",
"Display": "each"
},
"[email protected]": "Parts('OR:wt.part.WTPart:205405')",
"[email protected]": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:206572')"
]
},
{
"ID": "OR:wt.mpm.coproduce.PrimaryCoproduceLink:205709",
"Quantity": 8890,
"Unit": {
"Value": "2",
"Display": "each"
},
"[email protected]": "Parts('OR:wt.part.WTPart:205405')",
"[email protected]": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:206572')"
]
}
],
"navigationCriteriaId": "OR:wt.filter.NavigationCriteria:331152"
}
* 
The applied navigation criteria are used for resolving the primary part and secondary part structures to generate the co-produce object structure.
URI with Expand
POST /Windchill/servlet/odata/ProdMgmt/Parts('OR:wt.part.WTPart:204541')/PTC.ProdMgmt.UpdatePrimaryCoproduceLinks?$expand=Primary,AlternateSetMaster
¿Fue esto útil?