Updating Multiple Department Data Objects
You can update the attributes of single or multiple Department Data objects or its subtypes by providing the OIDs of the existing objects in the body of the request body. You can specify the OID of only the latest iteration of a revision of the Department Data object or its subtype in the body of the request. You can update both modeled and all other types of attributes associated with Department Data object including IBAs such as enumerated lists. You can also choose to specify the Change object (Change Task, Change Notice) in the request body to record the updates.
To update a Department Data object, you must have Read and Modify access to the object. To update a Department Data object in the context of a Change, you must have Read and Modify access to the Change object.
To update the attributes of a Department Data object or its subtype, you must first check out the Department Data object. If a constraint is applied to the attribute, you must specify the internal name of the value specified in the constraint.
* 
You cannot update a Department Data object, if the specified object is already checked out by another user.
If the update of any of the Department Data objects fails, then all the changes are rolled back.
You cannot update the master attributes Name, Number, Supply Chain, Location, and Category.
If you specify an invalid object, then the request fails and returns an error.
Example: Updating Multiple Department Data Objects
This example shows you how to update the attributes of two Department Data objects specified in the request body. Use the following POST URI.
URI
POST /Windchill/servlet/odata/BomTransformation/UpdateDepartmentDatas
Request Header
POST /Windchill/servlet/odata/BomTransformation/UpdateDepartmentDatas
Request Body
{
"DepartmentDatas": [
{
"ID": "VR:com.ptc.windchill.enterprise.data.PlantFunctionalData:204632",
"Description": "Description1",
"TestAttribute": false,
"TestEnum": 8
},
{
"ID": "VR:com.ptc.windchill.enterprise.data.PlantFunctionalData:204792",
"Description": "Description2",
" TestAttribute ": false,
" TestEnum ": 6,
"DDGlobalString": "global",
"DDLocalLong": 56352331,
"@odata.type": "#PTC.BomTransformation.SubLog"
}
]
}
* 
To update attributes specific to a subtype of Department Data, you must specify the following attribute and value in the request body:"@odata.type": "#PTC.<DomainName>.<InternalNameoftheType>". For example, to update the attributes DDGlobalStringand DDLocalLong specific to a Department Data subtype, you must specify the following attribute and value in the request body:"@odata.type": "#PTC.BomTransformation.SubLog".
Example: Updating Multiple Department Data Objects in the Context of Change
This example shows you how to update the attributes of two Department Data objects in the context of Change. In this example, the OID of a Change Task is specified for each Department Data object in the request body. Use the following POST URI.
URI
POST /Windchill/servlet/odata/BomTransformation/UpdateDepartmentDatas
Request Header
POST /Windchill/servlet/odata/BomTransformation/UpdateDepartmentDatas
Request Body
{
"DepartmentDatas": [
{
"ID": "VR:com.ptc.windchill.enterprise.data.PlantFunctionalData:204632",
"Description": "Description1",
" TestAttribute ": false,
" TestEnum ": 6,
"ResultedByObjects@odata.bind": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:206797')"
]
},
{
"ID": "OR:com.ptc.windchill.enterprise.data.PlantFunctionalData:211058",
"Description": "abc",
"DDLocalString": "Description2",
"ResultedByObjects@odata.bind": [
"ChangeItems('VR:wt.change2.WTChangeActivity2:206785')"
]
}
]
}
The request adds the iteration of the revision of the updated Department Data object as Resulting object in a valid Change Task.
Similarly, you can specify the OID of a Change Notice object for each Department Data object in the request body.
Was this helpful?