Forum Discussion

Former_Member's avatar
Former_Member
Ideator I
8 years ago

Import Package Error

I created a package which contains ItemType, Form, and some other related objects. It exported successfully. When I try to import, I got this error: The update statement conflicted with the FOREIGN KEY constraint "FK_VIEW_RELATED_ID_4CAB505A". The conflict occurred in database "db_n", table 'innovator.FORM", column "ID". The statement has been terminated, in SQL: UPDATE [view] SET [RELATED_ID] = @related_id WHERE [ID] = @id When i open the form in the imported database, the form seems to pick up the changes imported. So what did the error mean, has the view not been updated, even though it looks ok on the form?

1 Reply

  • Hello, When you create a new ItemType, a Form is automatically created with a field for each non-hidden property. The relationship between an ItemType and a Form is called a View. By default, an item will contain references to all of its relationships when you export a package from your database. I've seen this issue several times before. The cause is typically that the Form is not included in the export package with the ItemType even through the View still exists. When you import the ItemType, Innovator tries to find the Form using the related_id of the View, and it throws an error because the Form does not exist. When you view the Form in your new database, I believe you're only seeing the default Form that is created because you added a new ItemType during the import. You can resolve this error message in two ways.
    1. Add the Form to the package in your old database and create a new export package
      • Good if you've made any customizations to the Form that you want to keep
    2. Manually edit the ItemType aml in the export package and remove the View relationship
      • Good if you're only using the default Form that is created anyway
    Chris
    Christopher Gillis Aras Labs Software Engineer