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
' Trap an F5
Function OnBeforeFunctionExecute_ViewRefreshCurrent (functionNumber, functionName)
OnBeforeFunctionExecute_ViewRefreshCurrent = True
' Trap a Ctrl-F5
Function OnBeforeFunctionExecute_ViewRefresh (functionNumber, functionName)
OnBeforeFunctionExecute_ViewRefresh = True
' Trap an F8
Function OnBeforeFunctionExecute_ViewListDetail (functionNumber, functionName)
OnBeforeFunctionExecute_ViewListDetail = True
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
I've found that MsgBox (or any GUI) in the Global (Event) scripts disrupts the normal real-time sequences.
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?