Reading/Creating/Updating Object Reference Type Attributes
When you create an Object Reference type of attribute for a Part object, an Object Reference navigation property is added in the metadata response of the domain. The suffix Nav is added to the Object Reference structural property name to form the Object Reference navigation property name. For example, if you create the Object Reference type attribute EnterpriseData for a Part object, then the Object Reference navigation property name is EnterpriseDataNav. The Object Reference navigation property always points to the PTC.ObjectReferenceable Type.
You can read, set, or update Object Reference type of attribute values using the Object Reference navigation property while retrieving, creating or updating Part objects or their subtypes.
This example shows you how you can create a Part object with required and other attributes. This example also shows you how to create an Object Reference type attribute EnterpriseDataNav for an Extended Data object. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ProdMgmt/Parts
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Name": "TestWTPart_001",
"AssemblyMode": {
"Value": "separable",
"Display": "Separable"
},
"PhantomManufacturingPart": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:48507000')",
"EnterpriseDataNav@odata.bind": "ExtendedDatas(OR:com.ptc.windchill.enterprise.data.EnterpriseData:200886)"
}
In this example, the response also shows the defined custom attribute that the custom logic uses to navigate to the Object Reference type attribute value set in the request. The request creates the Extended Data object specified in the Object Reference type attribute value and you can navigate to the Extended Data object from the value of the custom attribute.
URI with Expand on the Navigation Property
GET /Windchill/servlet/odata/ProdMgmt/Parts?$expand=EnterpriseDataNav