11-23-2010 06:43 AM
Anyone have a workaround for trapping an F5, F8, etc.?
12-03-2010 08:40 AM
Architect: Manage Secured Functions gives you a list of the Secured items like F5, F8, etc.
Add (to) a Global Script:
' Trap Save icon.
Function OnBeforeFunctionExecute_FileSave (functionNumber, functionName)
MsgBox "File Save"
OnBeforeFunctionExecute_FileSave = True
End Function
' Trap an F5
Function OnBeforeFunctionExecute_ViewRefreshCurrent (functionNumber, functionName)
MsgBox "F5"
OnBeforeFunctionExecute_ViewRefreshCurrent = True
End Function
' Trap a Ctrl-F5
Function OnBeforeFunctionExecute_ViewRefresh (functionNumber, functionName)
MsgBox "Ctrl-F5"
OnBeforeFunctionExecute_ViewRefresh = True
End Function
' Trap an F8
Function OnBeforeFunctionExecute_ViewListDetail (functionNumber, functionName)
MsgBox "F8"
OnBeforeFunctionExecute_ViewListDetail = True
End Function
OK, now that they are trapped, does anyone know how to have SLX fire them off if all is well? I thought that setting the function to True would do it (LAN 7.2.2), but the function isn't executing.
12-03-2010 09:52 AM
Try replacing:
MsgBox "whatever"
with
Application.Debug.WriteLine "whatever"
I've found that MsgBox (or any GUI) in the Global (Event) scripts disrupts the normal real-time sequences.
12-03-2010 12:35 PM
12-06-2010 07:06 AM
I'm looking at the Opportunity Management Global Script. SLX actually runs (or doesn't run) what is required based on business rules. And Always sets the function to True..
So now the question becomes, how do you trap an F5, if you are good to good, how do you rerun an F5. OK so Application.BasicFunctions.RefreshMainView will do the trick. And it doesn't do the trick depending on how a user is set up for MainViewPromptSaveChanges (that's the big difference between an F5 (keypress) and RefreshMainView (script).
What about an F8 or a Control-F5. won't the trap retrap itself?
12-15-2010 12:02 AM
I am not quite sure what you are trying to accomplish but you can trap the F5
very easy in a script. Application.Basicfunctions.DoInvoke "Function","RefreshCurrent:ViewRefreshCurrent".
Of course you will need an extra menu strip to overwrite the current entry in the menu.
Is that what you are looking for?
Regards,
Hartog