Additional Columns Execution Order?
My understanding of the purpose of ordering the fields in the Additional Columns window was to place them in an execution order. I have a calculated field which sets a global variable above a calculated field which uses that variable. As diagnosis I placed a MessageBox.Show() method at the end of the first field’s script and the beginning of the second field’s script. The message box for the second field is popping before the message box of the field field’s script.
In other words, my field that uses the global variable is running after the field that sets the global variable.
In other words, my field that uses the global variable is running after the field that sets the global variable.
Answers
Chad,
Your understanding of additional column execution order is correct. If both of those calculated columns are mapped on the same node they will run in the correct order. If you have them mapped to separate nodes they will display in the order the nodes are listed.
For example, if your map has a header and a line node and calc_column_1 is mapped in the header and the calc_column_2 is mapped in the line; and your line node is above the header node then calc_column_2 will show before calc_column_1.
If you want calc_column_1 to run on the line node then you will need to map it on the line node.
If you want your calculation in calc_column_1 to set the global variable on the line node without mapping a calculated column, you can put the calculation in the restriction of the line node. The restriction code will run before the line node every time it is ran.
Your restriction would look similar to the following.
GBL_MYVARIABLE = “some fun math”
return true
Your understanding of additional column execution order is correct. If both of those calculated columns are mapped on the same node they will run in the correct order. If you have them mapped to separate nodes they will display in the order the nodes are listed.
For example, if your map has a header and a line node and calc_column_1 is mapped in the header and the calc_column_2 is mapped in the line; and your line node is above the header node then calc_column_2 will show before calc_column_1.
If you want calc_column_1 to run on the line node then you will need to map it on the line node.
If you want your calculation in calc_column_1 to set the global variable on the line node without mapping a calculated column, you can put the calculation in the restriction of the line node. The restriction code will run before the line node every time it is ran.
Your restriction would look similar to the following.
GBL_MYVARIABLE = “some fun math”
return true
Is there any harm in changing the order of the nodes so that ‘Create cash receipt’ is before ‘Add distribution’?
Chad,
Yes there is harm. eConnect will want the distribution first. If you put the Create Cash Receipt node first you will likely receive a duplicate document error.