AnsweredAssumed Answered

Window Focus wrong after Hide Window on Windows XP

Question asked by disabled_PeterBouma on Feb 23, 2009
Latest reply on Feb 24, 2009 by TSDiva


Window Focus wrong after Hide Window on Windows XP

Description of the issue

Seemingly random records were deleted due to window focus error.Finally been able to reproduce it. General environment: FMP/FMPA 9.0v3, FMS, mixed platforms (Mac OSX 10.5.6; Windows XP Professional 2002 SP3; Terminal Server on Windows Server Standard (2007) SP1) Issue encountered only on Windows (both XP and TS). We have 98 files hosted on our FMS 10, but clients who reported the issue typically have less, say 30-50. Our standard (FMP5/6 legacy) solution, however converted to .fp7-format and now running under FMP9/FMS10, is still in the process of being rewritten/optimized/consolidated for FMP9/10. There are many relationships between tables in different files. As far as we can tell, the files are in fine health according to diagnostic tools we run regularly. What happens is this: - On a layout in File A there is a portal of related records from a table in File B;- in the portal of B-records there is a button that performs a script with a GTRR and some additional navigation (layout choice etc.) that makes File B the frontmost window, showing the related record (in an existing window);- on the layout of now frontmost File B there is a button to hide File B: it triggers a script with the script step Hide Window;- if the user clicks this Hide Window button, file B is hidden and it will appear in the hidden windows submenu; File A seems to be frontmost again;- in File A there is a button with a script that is supposed to delete the current record; originally this script did additional testing for permissions to delete, and showed a dialog ("are you sure?"), but we tested the procedure also with a single script step Delete Record, just to be sure the other steps weren't interfering. Expected behaviour:- the current record in the frontmost window (File A) should be deletedActual behaviour:- the related record in the hidden File B is deleted instead. Of course, we tried the same with Debugger/Data Viewer on. Watching Get(Windowname) however did not reveal FMP 'thinking' File B was still in front. Nevertheless, the Delete Record button in File A made the related record disappear from the portal of File B, instead of deleting the A-record.  A strange thing is that we could reproduce the problem consistently between some files in the solution, but not between some other pairs of files/relationships, although the relationships and script structure are quite similar. We have no clear idea where to look for essential differences.Using Maximize in the navigation made no difference. We have now been able to circumvent the issue by inserting in the Delete Record script a GTRR to the same record (filling a global with the recordID of the current record, and using that in a self-join). Apparently, the GTRR, which has only a reference to the , restores the misaligned window focus. The issue has a remarkable resemblance to the one described in Knowledge Base answer #6853, although that article explicitly only mentions Mac OSX 10.5.3 or lower, not Windows. HTH!Peter BoumaTrias Digitaal, Amsterdam, Netherlands