Recently encountered a problem, need a control modified, assign a value to several other fields,
But there is a problem, or you have to leave the control after the cursor, the other field values will change;
Either the entire picture is reloaded, and the data cursor is re-selected on the first data.
For the above issues, I reviewed the code for the purchase order header status update after the system purchase order is posted to the warehouse.
Code in the Purchformletter \ Mainonserver method, there are the following methods,
Purchformletter::updatecallerdatasource (Purchtable_ds, recordexists, doexecutequery);
After entering, the contents are as follows:
if (recordexists) { if (doexecutequery) { purchtable_ds.executequery (); } Else { purchtable_ds.reread (); Purchtable_ds.refresh (); Purchtable_ds.editpurch (); Purchtable_ds.rereadlines (); } } Else { purchtable_ds.research (); }
As in the code, when the data exists, either just requery the data or perform a refresh of the current record.
Yes, it is.
Purchtable_ds.reread ();p Urchtable_ds.refresh ();
These two lines of code play a role in refreshing the current record.
Refreshes the current record (the current data refresh caused by a control modification of the screen)