Hi,
*This post is locked for comments
Hi,
*This post is locked for comments
After a bit of investigation using the techniques you described, I ended up adding a button specifically for Friday which does as you suggested (focus, call original box).
The original button still launches Mon - Thu and still fails if used on a Friday AM or PM box....Clicking on the new Friday button *always* sets focus to the hidden Friday box and only launches Friday's notes.
Not the best, but it's a workable solution that allows the users to get at the notes as I investigate further and expand my understanding....
Thanks for your help, Barry!
Barry,
Wow, thanks for the very informative post! Now that I have a clearer understanding of how this works, I'll give you the specifics of what my assigned task is:
In the Timecard entry screen, there are controls (InGrid = true as well) for Monday thru Thursday. There is an existing customization that split Friday into 2 fields for AM and PM. I'm guessing that the "real" Friday control is being hidden using a technique similar to what you described. (EDIT: there is in fact, a hidden Friday field)
Now, ordinarily, clicking on any control Mon - Thu, then clicking on "Invoice Comments" button works just fine.
However, clicking on either of the new Friday boxes--AM or PM--then clicking on "Invoice Comments" button throws up an error saying the selected control does not contain day information. I would surmise that since these 2 buttons are hiding the real Friday textbox and these 2 boxes fail the criteria, this is why the "Invoice Comments" button is failing.
I was hoping to write code to (in pseudocode)
1) Check if selected control is the new AM or PM textbox then call PANOT00
I couldn't even find a call to check for Focused control...(HasFocus? IsFocused?)
2) Otherwise, use OOB/default processing to determine if PANOT00 should be called
But if the OOB behavior is doing the check for the hidden Friday box and immediately going to the Error MsgBox and disallowing running of PANOT00, I'm not sure how to "hijack" this. In my mind, a replacement button, can be coded with my "new" criteria, but if I called the existing button, it would still throw the error...
Hopefully, there is something else that can be done...and hopefully, I explained the situation clearly...
Specs: SL 7.0 FP1 - Advanced, v7.03.21203.02 (7.0.0.0) running on Server 2003 R2
Thanks!
Marc
Marc
The screen that you are customizing is a compiled .exe.
Customization Manager does not show you the source code of that screen, or allow you to modify it.
It does, however, allow you to write VBA code in the various Events.
In some cases the customization event will run before the host screen's event.
In other cases the customization event will run after the host screen's event.
In some Events (usually with a parameter called retval) your code can abandon that event.
For example in the Update control's OnUpdate event, which runs when the user clicks on SAVE, your code can cause the Save operation to be aborted and abandoned.
For a button, about all you have is the Click event, and, to my knowledge, there is no ability to "abandon the click".
However there is a workaround, which doesn't always work :)
Change a couple of properties on the button.
Set TabStop to false.
set Left to, say, -1000.
That effectively makes the button totally inaccesable to the user.
Now use the Insert Wizard to add your own button to "replace it".
Now when the user clicks "the button", it will be "your button", not the "real one".
If your code determines that you don't want to call PANOT00, then simply exit, and it won't get called.
If you decide that calling it is OK, then you must programmatically click the "real button".
And it is this bit that may not work.
Or if it works now, it may cease working in a future version.
Here's a couple of ways of possibly pushing a button.
If neither works, post the SL Version that you are using, and I might be able to do a little experimenting.
Call ApplSetFocus("TheButtonsName")
Call SendKeys(" ",true)
or
sivmyapp.controls("TheButtonsName").value = true
Hope that helps a bit.
Barry
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156