Reader's Clinic - Related Windows
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Sprezzatura Ltd | 01 MAR 1991 | 2.03+ | EXPERT | RELATED, WINDOW, RELATER, WC_DISPLAY_ACTION%, WC_RESET%, STATUS() |
Several readers have asked "When I call a related window from my current window to add related records, is it possible to have my current window reflect these changes when it returns?"
In the classic customer/invoice example, the invoice window might be a related window from the customer screen. The user might be able to softkey to the invoice window, add another invoice and then return to the customer window. Under these circumstances, @RECORD contains the linking IDs and being in memory is not updated.
Note that the system routine responsible for updating related indexes (RELATER) checks to see if the lock set on the file to be updated is that of the current workstation (i.e.STATUS() is set to 1). If so the lock is ignored and the update takes place regardless. This is because when a record is written to disk, SI.MFS reads the old record in and ensures that any protected fields (as "related to" fields would be) are the same as the disk copy. If not they are changed to reflect the disk copy.
Thus on the post window code and command option for a related window, a call to a commuter program that simply reread the new values and inserted them into @RECORD could be used. If the values were displayed on screen, WC_DISPLAY.ACTION% and WC_RESET% would also need to be set to redisplay the new values. E.g.
POST_REL_SHIFT_F1: * We already have lock so just ignore it and continue with the read READ R FROM SRC.FILE,@ID THEN * Replace appropriate field numbers here @RECORD<22> = R<22> * If needed WC_DISPLAY.ACTION% = 7 WC_RESET% = 5 END RETURN
(Volume 2, Issue 9, Page 3)