Cannot create a record in . The record already exists.

This question is answered

I have created a custom table, it contains 2 fields: A custom code (DS72), which uses a number sequence I have setup and ItemId. I have joined this table as a datasource to the InventTable form and am displaying the value held in this for any associated Item's in the grid view. The problem is, when I edit an item which doesn't have a DS72 code attached, I get the following error:

Cannot create a record in BTN_DS72 (BTN_DS72). DS72: .

The record already exists.

 

When I go to the DS72 form, it seem's to have created or tried to create a new entry for some reason? I don't know why it does this?

Verified Answer
  • You can consider using a display method to show the custom table value instead of adding a datasource to the form.

    My blog | PBC

    This posting is provided "AS IS" with no warranties, and confers no rights.

All Replies
  • You can consider using a display method to show the custom table value instead of adding a datasource to the form.

    My blog | PBC

    This posting is provided "AS IS" with no warranties, and confers no rights.

  • But if I do that it's not possible to right click > go to main table to easily create a new DS72 code.

  • I assume the relationship between InventTable and your custom table is 1-to-1?

    If that's true, then you should look at edit method.

    (msdn.microsoft.com/.../aa637541.aspx)

    Perform record create/edit/delete for the custom table inside the edit method.

    My blog | PBC

    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Yes the relationship is 1:1