Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
I have one record, that was migrated to Windchill 9.1 years ago. It is just now being modified, but it gives me an error when I do check out and edit, then check in. "The Value for attribute Comments violates constraints defined for this attribute."
So there is a value entered in the Comments field it is "Part number: 23379G006, G008, G020", but when I do check out and edit, the Comment field appears blank. How can fix this?
Can I go into another area of the database of this particular record and just clear out the comment because it's having an issue with it? We need to edit record this record.
Solved! Go to Solution.
I would say even the approach mentioned by Bob should be safe as there are no other dependencies on string value table. I also tried the same behavior on 9.1 M050 server. Following are my observations
1. Created an multivalued attribute, created a part with 3 values and then added a single value constrain on the part type and tried edit options. I get the same error
2. Removed the single value constraint for a moment and tried editing the object, I can see all the values, remove all but one and I was able to check-in successfully. Re-added the constraint and the part has no issues now.
Regards,
Bhushan
It seems you have missed some required attribute value. Are you sure this error is because of the "Comments" field?
The error says it's the Comments field. I've corrected all fields. Some attribute values are no longer available and I am trying to correct those but it's not letting me. Other similar records are not giving me this problem when trying to update?
Can you check if there is any OIR (object initialization rule) set for this attribute with RequiredValue constraint.? I guess there might be some constraint to throw an error.
You can access this page under Business Administration of Product/Library > Utilities or Org/Site> Utilities.
But would that matter, it's only happening on this one record? All other records of the same type, with the same attributes, are allowing me to check in.
what is written in method server log?
I'm sorry I'm not sure how to view the method server log. I may need to ask our Systems Administrator. We lost a few people that used to manage these things so I'm just trying to figure out on my own?
This is a method I wouldn't recommend as a first attempt, and if possible should be attempted in a test/dev environment first.
You can try this from the DB back-end side:
Start with these queries:
Check that the result of number 3 matches, letter for letter, the text in the field you are looking for. There will likely be multiple results on item 3, but you want to isolate the one record for this item.
Back up the stringvalue table first (create table stringvalue_bkup as select * from stringvalue;), then delete this single record you ended up with.
You may need to refresh the Windchill page or possibly restart WC afterwards.
I guess our Administrators put in a PTC ticket on this. System Administrator thinks it's a Windchill software issue and not in the database. But it's just with this one record. At least it's only one I've identified from this time period when records were migrated into Windchill? So I guess I will wait?
I did a compare on another similar record that I have no problems checking in. I notice on the problem record that there are parenthesis brackets in the Comments field. I wonder if it's the brackets that is causing the issue?
You could check that by attempting to make a new WTPart and use that exact same value for "Comments" and see if you get an error not allowing you to create it (or just use the brackets as the text). If you do, you could use the same method I suggested, but instead of deleting the record, just modify the value field(s) to remove the [ and ] characters.
I don't get any error on new parts getting created, even if I add in those brackets as text. I cannot delete the entire record. We just need to change the fields.
Looking at the comparison report, it looks like the attribute is multi-valued. It would be a good try if you can remove the single value constraint on this attribute during off-hours and try the same steps again. You can revert the changes after the try.
Regards,
Bhushan
The attribute in the OIR and in the Type and Attribute Manager have the value as Single Valued Constraint. How do I remove it on this one record?
Oh do you mean change the whole attribute to something else?
Parenthesis is displayed when the attribute has multiple values in the comparison report. On the details page these are displayed as comma separated. It is not possible to remove the constraint on a particular object. You may want to try removing the constraint on the part type when no one is accessing the system and remove the additional values from this particular part and finally put the constraint back.
The "single value" constraint is applied to the type, which then propagates to objects as they are created. While it is possible, it certainly isn't feasible to single out objects of a specific type to remove this constraint while others have it, without some serious DB modification.
What I would suggest is to use the steps I supplied above, and see if you an isolate the three records in the stringvalue table that construct this "entire" value. Modify one to be the "complete value", and then delete the other two. Thus, instead of removing the single value constraint, you actually consolidate the three values to one.
While Bhushan provides a good option, modifying the object type does NOT retroactively go back an update objects to the new type. If you remove the constraint in the Type and Attribute manager, all objects that were created WITH that constraint will continue to have it.
I would say even the approach mentioned by Bob should be safe as there are no other dependencies on string value table. I also tried the same behavior on 9.1 M050 server. Following are my observations
1. Created an multivalued attribute, created a part with 3 values and then added a single value constrain on the part type and tried edit options. I get the same error
2. Removed the single value constraint for a moment and tried editing the object, I can see all the values, remove all but one and I was able to check-in successfully. Re-added the constraint and the part has no issues now.
Regards,
Bhushan
Thank you. That worked for me and this record.