Updating Pending Effectivities for an Effectivity-managed Resulting Object
You can update single or multiple pending effectivities (Date, Lot, Unit, or Serial and their attributes for a specific effectivity-managed resulting object (Part, Process Plan, Operation, Sequence, Resources, Extended Data, or Department Data) or its subtype in the context of change. To update pending effectivities in the context of change, you must have Modify permission to the relevant change task.
To update pending effectivities, you must specify the pending effectivity OIDs, effectivity type, and the effectivity ranges in the request body.
You can also update the pending effectivities with effectivity context.
To update the pending effectivity, you must reserve the relevant change task for Edit.
* 
The request fails and returns an error if you:
Do not have Modify permissions to the existing change task.
Do not reserve the change task for Edit.
Specify an invalid object OID.
Do not provide all required attributes.
Specify an invalid effectivity context, effectivity range, or effectivity format.
Provide a Trace Code that is not compatible with the specified effectivity type.
Request to change the effectivity type.
* 
If you do not provide the effectivity type (@odata.type), the default effectivity type is used. As the specified attribute for the default type is not modeled, you get an error message that the attribute is invalid, for example, "'PendingDateRange' cannot be mapped as a property or an annotation."
Example: Updating a Pending Date Effectivity
This example shows you how to update a pending Date effectivity by specifying the change task OID and the ResultingLink OID in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ChangeMgmt/ChangeTasks('VR:wt.change2.WTChangeActivity2:214120')/ResultingLinks('OR:wt.change2.ChangeRecord2:214708')/PTC.ChangeMgmt.ModifyPendingEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PendingEffectivities": [
{
"ID": "OR:wt.eff.PendingDateEffectivity:214991",
"@odata.type": "#PTC.ChangeMgmt.PendingDateEffectivity",
"PendingDateRange": {
"StartDate": "2021-10-12T00:00:00+02:00",
"EndDate": "2021-10-17T00:00:00+02:00"
}
}
]
}
Similarly, you can update other types of pending effectivities.
Example: Updating All Types of Pending Effectivities
This example shows you how to update all types of pending effectivities (Date, Block, Serial, Lot) with effectivity context by specifying the change task OID and the ResultingLink OID in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ChangeMgmt/ChangeTasks('VR:wt.change2.WTChangeActivity2:214120')/ResultingLinks('OR:wt.change2.ChangeRecord2:214708')/PTC.ChangeMgmt.ModifyPendingEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PendingEffectivities": [
{
"ID": "OR:wt.eff.PendingDateEffectivity:214735",
"@odata.type": "#PTC.ChangeMgmt.PendingDateEffectivity",
"EffectivityQualifier": {
"Value": "EXACT",
"Display": "Exact"
},
"PendingDateRange": {
"StartDate": "2022-01-01T00:00:00+00:00",
"EndDate": "2022-01-05T00:00:00+00:00"
}
},
{
"ID": "OR:wt.eff.PendingDateEffectivity:214736",
"@odata.type": "#PTC.ChangeMgmt.PendingDateEffectivity",
"EffectivityQualifier": {
"Value": "EXACT",
"Display": "Exact"
},
"PendingDateRange": {
"StartDate": "2022-02-10T00:00:00+00:00",
"EndDate": "2022-02-15T00:00:00+00:00"
},
"EffectivityContext@odata.bind": "PartEffectivityContexts('OR:wt.part.WTPartMaster:214537')"
},
{
"ID": "OR:wt.eff.PendingLotNumberEffectivity:214733",
"@odata.type": "#PTC.ChangeMgmt.PendingLotEffectivity",
"EffectivityQualifier": {
"Value": "EXACT",
"Display": "Exact"
},
"PendingUnitRange": {
"RangeStart": "610",
"RangeEnd": "700"
},
"EffectivityContext@odata.bind": "PartEffectivityContexts('OR:wt.part.WTPartMaster:214537')"
},
{
"ID": "OR:wt.eff.PendingBlockEffectivity:214732",
"@odata.type": "#PTC.ChangeMgmt.PendingBlockEffectivity",
"EffectivityQualifier": {
"Value": "EXACT",
"Display": "Exact"
},
"PendingUnitRange": {
"RangeStart": "500",
"RangeEnd": "600"
},
"EffectivityContext@odata.bind": "PartEffectivityContexts('OR:wt.part.WTPartMaster:214537')"
},
{
"ID": "OR:wt.eff.PendingSerialNumberEffectivity:214734",
"@odata.type": "#PTC.ChangeMgmt.PendingSerialNumberEffectivity",
"EffectivityQualifier": {
"Value": "EXACT",
"Display": "Exact"
},
"PendingUnitRange": {
"RangeStart": "700",
"RangeEnd": "800"
},
"EffectivityContext@odata.bind": "PartEffectivityContexts('OR:wt.part.WTPartMaster:214582')"
}
]
}
Example: Updating Multiple Pending Serial Effectivities
This example shows you how to update two pending Serial effectivities with the same effectivity context and effectivity type, but different effectivity range. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/ChangeMgmt/ChangeTasks('VR:wt.change2.WTChangeActivity2:214120')/ResultingLinks('OR:wt.change2.ChangeRecord2:214774')/PTC.ChangeMgmt.ModifyPendingEffectivities
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"PendingEffectivities": [
{
"ID": "OR:wt.eff.PendingSerialNumberEffectivity:214793",
"@odata.type": "#PTC.ChangeMgmt.PendingSerialNumberEffectivity",
"EffectivityQualifier": {
"Value": "EXACT",
"Display": "Exact"
},
"PendingUnitRange": {
"RangeStart": "700",
"RangeEnd": "800"
},
"EffectivityContext@odata.bind": "PartEffectivityContexts('OR:wt.part.WTPartMaster:214582')"
},
{
"ID": "OR:wt.eff.PendingSerialNumberEffectivity:214794",
"@odata.type": "#PTC.ChangeMgmt.PendingSerialNumberEffectivity",
"EffectivityQualifier": {
"Value": "EXACT",
"Display": "Exact"
},
"PendingUnitRange": {
"RangeStart": "900",
"RangeEnd": "1000"
},
"EffectivityContext@odata.bind": "PartEffectivityContexts('OR:wt.part.WTPartMaster:214582')"
}
]
}
Was this helpful?