cancel
Showing results for 
Search instead for 
Did you mean: 

happening validate event after Selection list is selected and closed

Former Member
0 Kudos
222

Hi

I have a key field that "ItemCode" in my form.

when the field is empty and tab key is pressed, then selection list is opened. I select the item from list and press OK, then item is filled in ItemCode field.

In this case, no event is happen. so i must press the tab key or click another fields to make running validate event. but i wanna make it directly happen when field is filled from selection list.

If you have a solution or sample code about it, please help me.

Accepted Solutions (1)

Accepted Solutions (1)

FOA
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rok,

As a guidance of which events are triggered by the UI API, you can always use the "EventSpy" that you can find in folder "C:\Program Files\SAP Manage\SAP Business One SDK\Samples\Utility Projects\EventSpy".

For your case, you can use event et_FORM_ACTIVATE, this means that you will get this event when your form gets again focus and after your "selection form" is closed.

HTH,

Felipe

Former Member
0 Kudos

Hi Felipe

Your advice is good. but I have another problem in this case what using et_FORM_ACTIVATE.

When ItemCode Field is filled, some methods are running in that case. And if I write the codes in et_FORM_ACTIVATE event that were coded in validate event, methods are running not just when come back from selection list also all cases of the form get focus. So everytimes when the form is got focus, method is running. It is sooooooo bad performance.

How can I do? ==;

barend_morkel2
Active Contributor
0 Kudos

use et_FORM_LOAD, then the logic will only run once - when the form is loaded...

FOA
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rok,

You can set a Flag when the selection form is opened, let say = true. Then you can process the et_FORM_ACTIVATE just when this flag is = True. After you call your methods, set it to false. This way your methods will not be executed each time the form gets focus, but when it gets focus after the selection form was selected.

You can also, check when the "ok" button of the Selection Form is pressed(et_item_pressed), and when Action Sucess is = true, you can call your methods.

Hope this helps,

Felipe

Former Member
0 Kudos

Hi felipe

The Flag! That was good!

Thanks for your advice.

Answers (0)