I set the table relation at one field “UOM” of table #1 to link this field to another table, e.g. Item Unit of Measure. There is another field named “Item No.” in table #1. At the form of table #1, if user select the existing item, the “UOM” field will show the data at Item Unit of Measure table. And when user click the lookup button, the form of Item Unit of Measure will show out. But if the item doesn’t exist, I want a blank form of Item Unit of Measure shown. But I got error because at this point, the new item is not saved at Item table. So, how can I do?
Navision avoids this by having the record inserted as soon as you enter the key. If you already have the item number set, is there a problem inserting it before you do the lookup. If you don’t have the item number set then the lookup is kind of useless anyways. There are other workarounds, but this is the simplest.
In the form, you can add the statement CurrForm.SaveRecord. This saves the record before it performs the lookup. To see how it works, look at the Sales Order SubForm in the “No.” field.