Sorting BY VARIABLES in Dataport


i have a dataport based on “sales invoice header” table and dataport fields are the following:

g_V1 (global variables data retrieved from other table)

g_V2 (global variables data retrieved from other table)

currency code ( from “sales invoice header” )

Amount ( from “sales invoice header” )

due date ( from “sales invoice header” )


thx in advance

Are you exporting data or importing? If exporting you should be able to set the DataItemTableView with the correct key. On importing you could put it into a temp table and sort it there.

i am exporting data and i want to sort the exported by g_V1

how can i do that?

Ok so on your dataport click on the service invoice header and click the properties(SHIFT F4). Look for dataitemtableview(close to the top). You can pick a key g_V1 as your key and then set the sort. If g_V1 isn’t an option you will need to go to that table and create another key. Be careful because this can/will effect the speed of inserting data into this table. To add a key to a table go to the table in design view, click view, then keys. Hope this helps.

I believe as Elie stated, the items that need to be sorted are not fields, but global variables. So you can’t set a key or a table view on them.

If you need this sorted in the output file I would suggest processing the data into a buffer table that does have the keys specified that you want to sort on. You could do all of the processing in the OnPreDataport trigger and then your data item can take care of the exporting.

Alternatively the user could open the file in Excel and sort however they want.