Creating a Resource Uses Link with Occurrences
You can create a Resource Uses link with occurrences for a parent resource by specifying the parent Resource OID in the request URI.
This example shows you how to create two Uses links with one occurrence each for the same child Tooling object by specifying the parent Tooling OID in the request URI. This example shows how to add the child Tooling object with two occurrences of quantity 2 each. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/Resources('OR:com.ptc.windchill.mpml.resource.MPMTooling:196079')/Uses
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Quantity": 2,
"Unit": {
"Value": "ea",
"Display": "Each"
},
"FindNumber": "100",
"LineNumber": 2,
"TraceCode": {
"Value": "0",
"Display": "Untraced"
},
"Uses@odata.bind": "Resources('OR:com.ptc.windchill.mpml.resource.MPMTooling:196104')",
"Occurrences": [
{
"ReferenceDesignator": "R121"
},
{
"ReferenceDesignator": "R162"
}
]
}
The request creates two Uses links with one occurrence each of quantity 2 and designated by Reference Designators R121 and R162, respectively.