Adding and Deleting Rows

Adding and Deleting Rows

Overview

You can add new rows and delete existing rows. For simple Data Trees containing a single Entity this is straight forward. For complex Data Trees containing relational data it can be more complex, as the related rows in other Entities also needs to be considered.

Adding and deleting rows is done using the icons in the grid view or form view toolbars:

Icons

Descriptions

images/download/attachments/42173298/RowInsert.png

Add a new row to the end of the data

images/download/attachments/42173298/RowDelete.png

Delete the selected row(s)

Alternatively deleting rows can be performed by right-clicking on the row header in the grid view or Table widget in a form.
images/download/attachments/42173298/adding_and_deletig_rows.png

When deleting rows there is a restriction that if more than 1000 rows are deleted the operation cannot be undone. Also for deleting very large numbers of rows the underlying database may impose restrictions and you might need to perform the deletion in smaller chunks e.g. 5000 rows at a time.

Adding rows

Clicking on the 'New row...' icon will open a dialog that lets you specify the data to add. The Entity to which the row is added is determined by the current selection. In the grid view there is only one Entity present, but a form can contain multiple Entities. The currently selected widget is used to determine to which Entity the row is to be added. For instance, if you have selected a detail Entity then the row will be added to this, but if you have a widget from the master Entity selected (or no selection) then the master Entity (the one at the root of the Data Tree) will be used. When the new row is added it will appear as the last record of your data e.g. as the last row in a grid view or table widget or as the last record of a form.

When adding a new row, you have a possibility to pre-load values based on the row from the selection. The "Load" button in the wizard toggles to "Clear", once the data is loaded.

images/download/attachments/42173298/addRowLoad.png

images/download/attachments/42173298/addRowClear.png

Possibility to "pre-load" the data from selection

Possibility to clear the "pre-loaded" data from selection

In case of inserting data to a child entity, the dialog will notify you about the parent's entity row too.

Deleting rows

Similarly to inserting rows, deleting them is usually straight forward, but there are complications when deleting rows from relational data. Where the row you are deleting is involved in a relationship to multiple rows (in the case of a one-to-many or many-to-many relationship) it is necessary to distinguish between just deleting the row for just the current entry and deleting it completely from the database, in which case it will also be deleted from any other rows that reference it.

Consequently, in these scenarios the delete row dialog lets you distinguish between these needs. Make your choice carefully!

images/download/attachments/42173298/adding_and_deletig_rows3.png

Another factor that can affect deleting rows from relational data is the setting for the 'On Delete' action in the database constraint that was created when the relationship was created. For instance if the CASCADE option was chosen then related rows will be automatically deleted for you, but other options will leave them in place, or may prevent deletion of the row until all related rows have been removed. Consult your database documentation for full details.

Because of these potential complications in deleting rows you are advised to test that the behavior is what you expect with some test data first.

Queries

When rows are added or deleted IJC makes no attempt to reflect the current query status. Thus your new row may be visible, even though it does not match your current query criteria. We think this is more intuitive than adding the row to the database but then potentially not displaying it. To query should be re-run if you want the displayed data to be correct.