Rename "Customer No." in customer not successfully

in some case rename “Customer No” in Customer Card. I can’t do it. It display error “The field below must be included in the table’s primary key. “ Field: Name Table : Customer By the way I import Customer Table by Dataport. Is it involve for error ?

Suebsant, As indicated by the errory message, you should use RENAME for changes to primary key fields, and MODIFY for other fields. The primary key for Customer table consists of “No.” only. Alastair

Was any solution found to this? I am getting the same error on items. When renaming an item from the card (field: Item No.) I get the same sort of error but the field it tells me SHOULD be included in the primary key is Search Description. I doubled checked the primary key on the item table and it is No. and I even looked at the onRename trigger - no mods. Error occurs right at the end of the onRename trigger. Thanks

There is one Table (perhaps more) in your Database containing a Field with a wrongly defined TableRelation. The TableRelation has been set to Item.“Search Description”. You have to find this Table/Field and remove the offending TableRelation - since it makes no sense anyway. There are basically 3 options to find this TableRelation:

  • Use the Developer’s Toolkit to find all references to Item.“Search Description”;
  • Export all Tables to a Text File and search for TableRelation=Item.“Search Description”;
  • Design a new Form based on the virtual Field Table, run it and apply filters to the RelationTableNo (=27, Item Table No.) and RelationFieldNo (=4, “Search Description” Field No.) Fields.
    I listed them in order of preference and quickness. [:D] [edit] humm… actually the order is reversed, from less prefered to most prefered, however silly that may be… [:P] [edit2] When renaming a record, the system will look for references to the previous key values. It does this by searching in all related Tables. The Tables are searched one after the other according to their ID. Since you say the error occurs at the end of the renaming process, I am lead to believe there are some custom Tables in this particular Database and one of these contains the error. Don’t forget to tell us what you find and if you manage to solve the problem.

Thanks Nelson, that fixed it. There was a relation that was entered in a table wrong (table 281) - customer had mad a custom field and didn’t set up the table relation correctly. I exported to text file and found it - only took about 5 minutes… Thanks again for the help.