Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

LAN: trapping Function Keys?

Anyone have a workaround for trapping an F5, F8, etc.?

 

 

RJ Samp
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: LAN: trapping Function Keys?

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.

 

 

RJ Samp
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: LAN: trapping Function Keys?

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.

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: LAN: trapping Function Keys?

No go on the Application debug writelines.
RJ Samp
Highlighted
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: LAN: trapping Function Keys?

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?

RJ Samp
Copper Elite Contributor
Posts: 33
Registered: ‎08-05-2009

Re: LAN: trapping Function Keys?

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