Add

Tuesday, August 18, 2009

How to create a Dataport

To create a dataport
1. Click Tools, and then click Object Designer.
2. In Object Designer, click Dataport, and then click New.
3. In the Properties window for the new dataport, set the following properties.

PropertyValue
FileFormat PropertyVariable
FieldStartDelimiter Property"
FieldEndDelimiter Property"
FieldSeparator Property;

*The format of the external file is variable and uses a semicolon as the field separator. This is because the external editor is Microsoft Excel, and for this use, a .csv file is appropriate.You have created a dataport and must now specify which tables and fields will be used in the dataport.

For Eg:

To add a data item for the Item table

1. In Dataport Designer, in the first DataItem field, click the AssistButton, and then select the Item table.
2. In the Properties window of the Item data item, in the DataItemTableView property, click the AssistButton.
3. In the Table View window, in the Key field, click the AssistButton, and in the Key List window, select the No. field.
4. Click View, and then click C/AL Globals.
5. In the C/AL Globals window, create a global variable called Tariff Number of data type Record, with the Tariff Number table as the subtype.

Next, you add fields to the data item.

To add fields to the Item data item

1. In Dataport Designer, select the Item data item, click View, and then click Dataport Fields.
2. In Field Designer, in the first row, in the SourceExpr field, click the AssistButton, and then in the Field List window, select the No. field.
3. Repeat step 2 to add the more Fields.
4. Save and compile the dataport.

No comments: