I would like to create a dataport that uses a trigger to get another field from another table to be exported to an excel spreadsheet. The main table is the purchase line, the table that I need more information from is the item table. We had a change made to the item table to enclude a field called size code. Each item number has this field associated to it. I would like to export from the purchase line table the blanket orders that have been created. The size code field is not in the purchase line table. I have been told to use a get command as a trigger to export the size code that corresponds with the item number coming from the purchase line table. Big question HOW?

Add a global variable SizeCode of the appropriate data type. Add that variable to your dataport fields. In the OnBeforeEvaluateField trigger of that variable, you can place the logic to GET the data you need and move it into your global variable to be exported with the rest of the data. Something like: OnBeforeEvaluateField (VAR Text : Text 260) <–Trigger Item.GET(“Item No.”,“No.”); MyGlobalSizeCodeField := Item.“Size Code”;

Thanks David I’ll try this. As you must have guessed I’m new to the programing part of Dataports.

Dave I know our rep has told me this before but I can’t remember how or where to look for data type of a record. I think the record “Size Code” is a text data type but I would like to make sure I am correct. Thanks Sbanatt

Proceed to the Object Designer. Choose “Tables”. Highlight your Item table (assuming that’s where the Size Code field resides). Press the Design button. Scroll down until you find your Size Code field (it is likely at the bottom of the list of fields). Read the data type of the field (on the same line with the name). Then exit carefully. I suggest that you DO NOT save any changes as you may cause a serious problem if you change anything inadvertently. I have assumed you have Login Permission to access the Table Designer. Good luck.

You don’t need an additional global variable. Just do the GET in the OnBeforeExportRecord() trigger, then add Item.“Size Code” to the Dataport Fields list.

Dave I did what you suggested only I highlighted and copied the table into an excel spreadsheet for future reference. Thank you for helping me with that part. I found out that “Size Code” record is type Code. Does this change any of the suggestion you and Bob Brown have been giving me on how to call this record into another dataport? Thanks Sbanatt

No, the data type doesn’t affect the suggested approach.