My main table (named for example MySetupTable) has a field named SetupMainAccount, which is related to the system table MainAccount through its field RecId. The field shows Account Number from the MainAccount table, but the client also wants to see the Account Number value in a separate read-only column in a form grid. I've done it by adding MainAccount table to the form's data sources, along with my main table, and specified the relation between the two data sources. Everything looks fine in there, but when the Account Number is updated in the grid (through a drop-down control), the Account Name is not updated until the record is saved in the database. My client would like to have the Account Name updated as soon as the value is changed on the form. I have tried to achieve this by overriding the modified method of the MainAccount field of the main table data source. And I have tried all of these, both separately and combined:
MySetupTable_ds.refresh();
MySetupTable_ds.research(true);
MainAccount_ds.refresh();
MainAccount_ds.research(true);
The only method that produced the result that I wanted (updated Main Account Name value right after the Account Number is updated) was MySetupTable_ds.research(true). But the problem with calling this method from the overridden update method is that it not only refreshes the data source, but also submits the changes to the database, which is not a desired behavior I suppose. So my question is - is it possible, and if it is how, to have the lookup field on the form (Account Name in this case) updated based on the selection in the related field (Account Code)?