cancel
Showing results for 
Search instead for 
Did you mean: 

item name

Valued Contributor
Valued Contributor

Can item name be set as unique valor? I mean that no other item can share the same valor for item name.

4 REPLIES

Re: item name

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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.

 

 

Harish

Re: item name

Phenom
Phenom

You may try using Multi field key.. replace MultiFieldKey(item_id), which is default, with MultiFieldKey(object_name). See screenshot.

 

This is just what I know from Tc Help. So no idea how it actually works.

 

 

Re: item name

Creator
Creator
I have to agree with Harish on the fact that by doing this you are setting up two different unique keys for the same object. This can get complicated and can overly tax the database, unless you plan on using the name as the only unique ID for the item. However, in that case you will find that you may have two items that are exactly the same but may come from a different vendor/supplier/source and one of them already has a generic item name, now the second one has to have some marker/tag on its name to make its name to make it unique. Then if a third one is identified, it too has to be made unique. Now you have a problem with searching for items by their name.

Think of it this way, if you were creating a phone book app where every user had their own phone and every user was unique, you would not force them to have a unique name, since there are probably many John Smith's out there. You would instead use their phone number as the unique ID.

Re: item name

Valued Contributor
Valued Contributor

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.