cancel
Showing results for 
Search instead for 
Did you mean: 

I need to execute a formatted search when the field loses focus

Former Member
0 Kudos

Is this even possible? I do NOT want to force the users to press shift-f2 every time to validate/search on every field on the form. This is absurd. How can I trigger a formatted search on a field when it loses focus?

I tried activating menu item #7425, but it's not executing the one on the field that loses focus, but a different one. I guess it only works on the active field??

I tried catching an earlier event, but after it executes the formatted search on the right field, it places the value on whatever field just gained focus instead of the one it was assigned to.

Any ideas here? We cannot force our users to press shift-f2 on all these fields!

The only other idea I have is to not use a formatted search but instead try to create some sort of popup form with a grid and my own query. There has to be an easier way, right?

Accepted Solutions (1)

Accepted Solutions (1)

AdKerremans
Active Contributor
0 Kudos

Hi Bryan,

You can create te formatted search to automatically run when another field is changed, press autorefresh when field changes, when defining the formatted search.

Regards

Ad

Former Member
0 Kudos

Yea, I know, which is practically useless. We want to base the formatted search on the <b>current</b> field, not on some other field on the form. We noticed that SBO does everything in its power to prevent you from triggering the formatted search when the current field changes (they've removed the current field from the drop-down list), so we had to go through a lot of trouble to write the query to look at the current field.

Let me repeat my question...I need to trigger the formatted search when the current field loses focus (or changes). It's the only logical and intuitive way for the user interface to operate. Basically, I want to do the exact same thing as pressing shift-F2 on the field, but I want it to happen when you click away or tab out of the field, so that it's automated instead of forcing the user to press shift-F2 every freakin' time.

Former Member
0 Kudos

Hi Bryan Williams,

This is possible with some development.

Write a small add on that will listen for KeyDown event and check for TAB key. If it user pressed TAB key and the field is empty then use Send Keys function for Shift + F2.

HTH

B Ravi Shankar

Former Member
0 Kudos

Bryan:

I use the following on a KeyDown event for when the User tabs out of a field after entering data if the data they entered is not valid. Perhaps you could try this in the LostFocus event:

g_B1Connection.Application.SendKeys("+") Also, I have used this in the KeyDown event: DisplayLookup("txtWO0") Private Sub DisplayLookup(ByVal objText As String) Try WOItem = WOForm.Items.Item(objText) WOItem.Click(SAPbouiCOM.BoCellClickType.ct_Regular) g_B1Connection.Application.SendKeys("+")

Catch ex As Exception

g_B1Connection.Application.MessageBox(ex.Message, "Ok", 1)

End Try

End Sub

Thanks,

EJD

Answers (0)