If an object attribute is editable (object_name is not editable IMHO)BMIDE lets you set 'unique' key to yes (its a checkbox). This makes the attribute value unique in the database.
An alternate way would be to do these in BMIDE:
- Set up custom attribute for name
- Set unique key on the custom attribute
- set 'object_name' complexProperty (property constant) to $<your custom attribute name>.
This should have the same effect, but do check your revise / save-as / duplicate/clone scenarios
A word of caution: You may want to revisit the use case that requires you to set name as unique: as you are now creating 2 keys for a Business object...usually something frowned upon by DB purists.
In our database each part has a number as a different number ID, so this field has to be unique and do not follow any code rule, it just pick the following free number. If the name field is not unique, it is not a problem in most cases; two different parts can share the name and be identified by the numberic ID, I don't like it but is not a problem. It is a problem though if the same part is added to the database twice. Some parts, specially of the shell components made by ourselfs or purchased, like screws... are naming through a rule and I want to avoid that they appear twice in our database, by for example massively importing legacy native data (imported to NX from other CAD systems) then we could have one item in some assemblies and other item in other but both items represent the same real part.
Our local dealer created a specific attribute and made it unique too. I think is a good aproach, just TC is having some problems handling it. I hope the problems will be solved soon but I wanted to ask just in case there are other possible approaches. Thank you all.