Replacing Made From Parts with Other Made From Parts
You can replace existing single or multiple Made From Parts (Raw Materials) associated with single or multiple finished parts or Made From Sets with other Made From Parts.
To replace an existing Made From Part with another Made From Part, you must specify the OID of Makes, that is, parent part (finished part or Made From Set), OID of MadeFrom, that is, other or replacement Made From Part, and OID of RawMaterialLink that exists between the parent part and the existing Made From Part, in the request body. You must have Modify permissions to the objects.
|
To obtain the RawMaterialLink OIDs, you can use the following GET request:
/Windchill/servlet/odata/ProdMgmt/Parts(‘OR:wt.part.WTPart:200561’)?$select=Identity,ID&$expand=MadeFromLink($select=ID;$expand=Makes($select=Identity,ID),MadeFrom($select=Identity,ID))
The request returns the information for the specified finished part or Made From Set and you can obtain the RawMaterialLink OIDs from the response.
|
If a Made From Part that you want to replace is also associated with a Process Plan under the parent part, then you can choose to replace it by specifying the RootPart OID and the inline NavigationCriteria.
RootPart is the root part in the Process Plan structure.
|
• When you replace a Made From Part, only the existing Made From Part associated with the specified revision of the finished Part or Made From Set is replaced with the other Made From Part.
◦ The Made From Links between other revisions of the same finished part or Made From Set object and the previous Made From object continue to exist.
• On replacing a Made From Part, the values of the attributes (Quantity and Line Number) on the corresponding Manufacturing Raw Material Link are retained.
• The finished part or Made From Set object is not iterated when the associated Made From Part is replaced.
• If the same Made From Part is also allocated to an Operation in a Process Plan under the parent part, then the replacement Made From Part is also allocated to the Operation along with the corresponding attributes, only when you specify RootPart and inline NavigationCriteria.
|
You can also choose to replace the Made From Parts in the context of Change (change task or change notice). You must first reserve the Change object for Edit. You must have Modify permissions to the Change object and Manufacturing History objects.
|
• When the Track “Made From” History Through Change Notice preference is set to Yes, you must specify the ChangeOid attribute and its value.
• When the preference is set to Yes, Manufacturing History Objects are added in the UI in the Resulting Objects table of the Change object specified in the ChangeOid attribute value.
|
Example: Replacing Made From Parts Associated with Multiple Finished Parts
This example shows you how to replace each Made From Part associated with three different finished parts. Use the following POST URI with expand and the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/ReplaceMadeFroms?$expand=Makes,RawMaterialLink,MadeFrom
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ReplaceMadeFromAssociations": [
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:201595')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:196355')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:201622')"
},
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:201307')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:196442')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:201327')"
},
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:201558')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:198824')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:201578')"
}
]
}
Similarly, you can replace Made From Parts associated with different Made From Set objects by specifying the Made From Set OIDs in the request body.
Example: Replacing Made From Parts Associated with the Same Finished Part
This example shows you how to replace two Made From Parts each associated with the same finished part. Use the following POST URI with expand and the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/ReplaceMadeFroms?$expand=Makes,RawMaterialLink,MadeFrom
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ReplaceMadeFromAssociations": [
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:200561')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:196550')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:200656')"
},
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:200561')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:196355')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:200655')"
}
]
}
Similarly, you can replace Made From Parts associated with the same Made From Set object by specifying the Made From Set OID in the request body.
Example: Replacing Made From Parts with “ChangeOid” Specified
This example shows you how to replace two Made From Parts associated with the same finished part in the context of Change. In this example, the preference Track “Made From” History Through Change Notice is set to Yes. Use the following POST URI with expand and the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/ReplaceMadeFroms?$expand=Makes,RawMaterialLink,MadeFrom
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ReplaceMadeFromAssociations": [
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:200561')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:196550')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:200656')"
},
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:200561')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:196355')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:200655')"
}
],
"ChangeOid": "VR:wt.change2.WTChangeOrder2:196476"
}
The request adds the parent finished part and the Manufacturing History objects in the Resulting Objects table of the Change object specified in ChangeOid.
Example: Replacing the Same Made From Part in a Process Plan Associated with a Finished Part
This example shows you how to replace a Made From Part associated with each of the three finished parts specified in the request body. Consider a Process Plan with an Operation is associated with the first finished part. The first finished part and the Operation under the Process Plan have the same Made From Part under them. This example also shows you how to replace same Made From Parts under a Process Plan and its associated finished part in a single call. Use the following POST URI with expand and the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/ReplaceMadeFroms?$expand=Makes,RawMaterialLink,MadeFrom
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ReplaceMadeFromAssociations": [
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:346152')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:346288')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:346278')",
"RootPart@odata.bind": "Parts('OR:wt.part.WTPart:346213')",
"NavigationCriteria": {
"ApplicableType": "PTC.ProdMgmt.Part",
"ApplicationName": null,
"ApplyToTopLevelObject": true,
"Centricity": false,
"ConfigSpecs": [
{
"@odata.type": "#PTC.NavCriteria.WTPartStandardConfigSpec",
"WorkingIncluded": true,
"View": "Plant1",
"LifeCycleState": null,
"Variation1": null,
"Variation2": null
}
],
"CreatedOn": "2022-03-26T10:30:30+05:30",
"Filters": [],
"HideUnresolvedDependents": false,
"LastModified": "2022-03-26T10:30:30+05:30",
"Name": "DefaultNCForPlant1",
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
},
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:201307')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:196442')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:201327')"
},
{
"Makes@odata.bind": "Parts('OR:wt.part.WTPart:201558')",
"MadeFrom@odata.bind": "Parts('VR:wt.part.WTPart:198824')",
"RawMaterialLink@odata.bind": "RawMaterialLinks('OR:wt.mpm.rawmaterial.RawMaterialLink:201578')"
}
]
}
The request replaces the three Made From Parts and also the Made From Part under the Operation in the Process Plan associated with the first finished part.