Tag Archives: lookup

Maps and MapEnumerators

This code put five records of the table CustTable in a map with the key AccountNum. Then the map is looped and the and AccountNum and customer Name is printed to the infolog.

The last part of the code finds the last AccountNum from from the loop directly from the Map, but after a check is done if the value is in the map. Performing a lookup for a value that doesn´t exist in map will result in a error.
Continue reading Maps and MapEnumerators

Simple field lookup in form

This is a simple way to add a custom form lookup to a new field with x++ code. This example is done with a test table named FO_TestTable that has the three fields “TestField1”, “TestField2” and “TestField3”. The table FO_TestTable has an index named “TestIdx”.

I have added a field on the table CustTable named TestField1. On this field that now can be found on CustTable form on the CustTable datasource node, I have added the “Override method” “lookup”.

Below you can see how I have edited the method lookup to fit my needs. Notice that the sysTableLookup is based on an ordinary query, this means that you can manipulate this query as you see fit.

Continue reading Simple field lookup in form