@Yognalawade wrote:
Hello Experts,
Set Revision API is failing to set the Manufacturing View Part as the same Revision as the Design part.
Use Case:
The Design part has A and B versions. On Design Part B Created a New Manufacturing Part then the Manufacturing Part created with Versions A. So we have to set the Manufacturing View Part Revision B to match with Design Part.
Below is the API :
VersionControlHelper.service.changeRevision ();
Failing with error: Version already exists, cannot create a duplicate: Part. seems I'm attempting to change the revision ID to a value that already exists or is currently in use. Unfortunately, we cannot modify the revision ID to a value that is already being utilized.
According to article https://www.ptc.com/en/support/article/CS162604 that Tony referenced this is one of those:
"Works to product specification:
How can I identify or what would the best steps to identified the actual issue behind this?
Seeing as how you are an actual PTC employee then you need to get R&D to actually fix the issue instead of bailing out with a "Works to Product Specification".
I have been successfully using VersionControlHelper.service.changeRevision() for years to correct revision labels. We have only used Design view. However are starting to look at using other views. Unlike Tony I just recently converted so down stream views have the same versioning scheme as the Design View. After that I have created a few new view versions and then tried using the VersionControlHelper.service.changeRevision() to set the revision of the Manufacturing view to be same as the Design View and had the same issue you are having:
"Version already exists, cannot create a duplicate: Part"
I have fixed this issue on my end by copying the relevant parts of VersionControlHelper.service.changeRevision() into my existing custom change revision class and modifying it to account for views. It is a simple change to the getControlBranchesOf() method to add SearchConditions to limit the controlbranches to the same viewId.