When you design a dataport in Microsoft Dynamics NAV, you add data items and you set properties on the data items. A data item is a table in the database. Most of these properties are the same and have the same function as the corresponding properties of a data item in a report. For more information, see Data Item Properties. In dataports, data items have three additional properties: AutoSave Property, AutoUpdate Property, and AutoReplace Property.
Properties for a Data Item
The following table lists properties that you can set for a data item in a dataport.
Property | Description |
---|---|
Defines how much the data item is indented. Can be set in the designer when creating data items. |
|
The table that the data item is based on. Can be set in the designer when creating data items. |
|
The name of the data item as a variable. The default value is the value of DataItemTable Property. |
|
The key, sort order, and filters to apply. If you set this property, users cannot change values for the data item during run time, and the tab for the data item is removed from the request form. |
|
The name of this tab on the request form. The default value is the name of DataItemTable Property. |
|
The translations of ReqFilterHeading Property. |
|
The names of the fields that initially will be included in the ReqFilter form. |
|
The names of the fields that will be calculated after a record has been retrieved. |
|
The DataItemVarName Property of a less-indented data item that this data item will be linked to. |
|
The link between the current data item and the data item specified by DataItemLinkReference Property. |
|
Defines if the imported records are automatically inserted into a C/SIDE table. |
|
Defines if the imported records are initialized with values from an existing record with the same primary key. |
|
Defines if imported records will automatically replace existing records with the same primary key. |
Remarks
The three Auto properties determine how the records that are read from the external file are handled. These properties are also used to resolve the conflict that arises when you import a record from an external file and it has the same primary key as a record that already exists in the database table.
AutoSave Property and AutoReplace Property are used to define how records are saved in the database table.
Note |
---|
If the value of AutoSave Property is No, the settings of AutoReplace Property and AutoUpdate Property have no effect. In this case, you have to handle any conflicts from your C/AL code. |
The following table outlines the effects of various combinations of settings of these properties.
Auto Save | Auto Update | Auto Replace | Record exists in database and in import file | Record exists only in import file |
---|---|---|---|---|
No |
The record in the database is not automatically updated or replaced. |
The imported record is not automatically inserted in the database. |
||
Yes |
No |
No |
A run-time error occurs, and the import is terminated. |
The imported record is automatically inserted in the database. |
Yes |
No |
Yes |
The imported record replaces the existing record. |
The imported record is automatically inserted in the database. |
Yes |
Yes |
The imported record updates the existing record. |
The imported record is automatically inserted in the database. |
Where no value is mentioned for a property, this means that the value is irrelevant.
Note |
---|
If AutoSave Property is set to No, it is possible to insert and modify records by using insert or modify from C/AL. |
See Also
© 2010 Microsoft Corporation. All rights reserved.