Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC Manufacturing Process Management Domain > Updating Attributes of MPMOperationToOperatedOnPartLink
  
Updating Attributes of MPMOperationToOperatedOnPartLink
To update the out of the box (OOTB) attributes of an existing MPMOperationToOperatedOnPartLink object, you must first check out the Operation object with which it is associated. You can also update modeled and all other types of attributes, including IBAs such as enumerated lists.
If you perform Undo Checkout on the Operation object, the changes are rolled back. When you update the MPMOperationToOperatedOnPartLink object, the version of the associated Operation will be iterated upon checking it in. To update the MPMOperationToOperatedOnPartLink object, you must specify the link OID in the request body.
To update an attribute, you must specify the value with its valid internal name. If a constraint is applied to the attribute, you must specify the internal name of the value specified in the constraint.
If you want to clear the value of an attribute, you can specify its value as null in the request.
If you do not specify an attribute in the request body, then the attribute retains its existing value.
* 
You cannot modify the following attributes: Line Number, Find Number, Traced Code, Quantity (if value is set to each), Unit (if value is set to each).
Example: Updating Attributes of an MPMOperationToOperatedOnPartLink Object
This example shows you how to update the attributes of an MPMOperationToOperatedPartLink object specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/Operations('OR:com.ptc.windchill.mpml.processplan.operation.MPMOperation:401543')/PTC.MfgProcMgmt.UpdateOperationToOperatedPartLink
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"OperationToOperatedPartLink": [
{
"ID": "OR:com.ptc.windchill.mpml.processplan.operation.MPMOperationToOperatedPartLink:277297",
"AllocationType": {
"Value": "disassembled"
},
"Unit": {
"Value": "l"
},
"AllocationSequence": 100,
"Description": "test",
"Quantity": 1
}
]
}
Example: Updating Attributes of Multiple MPMOperationToOperatedOnPartLink Objects
This example shows you how to update the attributes of two MPMOperationToOperatedPartLink objects specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/Operations('OR:com.ptc.windchill.mpml.processplan.operation.MPMOperation:401543')/PTC.MfgProcMgmt.UpdateOperationToOperatedPartLink
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"OperationToOperatedPartLink": [
{
"ID": "OR:com.ptc.windchill.mpml.processplan.operation.MPMOperationToOperatedPartLink:277297",
"AllocationType": {
"Value": "disassembled"
},
"Unit": {
"Value": "l"
},
"AllocationSequence": 100,
"Description": "test",
"Quantity": 1
},
{
"ID": "OR:com.ptc.windchill.mpml.processplan.operation.MPMOperationToOperatedPartLink:277298",
"AllocationType": {
"Value": "reassembled"
},
"Unit": {
"Value": "l"
},
"AllocationSequence": 101,
"Description": "test2",
"Quantity": 0
}
]
}