cancel
Showing results for 
Search instead for 
Did you mean: 

bypassing et_VALIDATE when setting an item value

Former Member
0 Kudos

We have a unique problem that we are trying to solve regarding multiple add-ons in our SAP B1 Implementation. I would like to know if there is any way of bypassing the et_VALIDATE event when I am setting a value on a system form (e.g. an EditText cell in the sales order item matrix).

Every time I set the value, an validate event (innerevent) gets fired and if I set BubbleEvent=false on it, I get a "Bad Form Value" when I try to set the field. Is there a setting that I can set for the UI-API to allow the new value while also disabling the validate event for this EditText.

The reason for this is that we are tying to disable the next AddOn from doing anything under this condition. From the reading the forums, I understand that setting the BubbleEvent=false on one add-on effectively disables that event on the following add-ons.

Thanks in advance.

Carlos

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Carol,

Your might use the wrong object to set value, if you use the "SAPbouiCOM.EditText" object to set value, please try change to use "SAPbouiCOM.UserDataSource" object to set value, then it will not fire the et_VALIDATE event.

Try it, I hope this can help you

Former Member
0 Kudos

Sorry , type the wrong name, should be Carlos....

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Carlos,

Look at the "ItemEvent" Event in the UI Help as you can also set the BubbleEvent and that may be what you are looking for. This is the same for 2004A and 2005A.

Hope that helps,

Eddy

Former Member
0 Kudos

Eddy,

I am using the ItemEvent already.

My problem is that I want to be able to set the field AND set the BubbleEvent=False on the subsequent Validate event for the EditField in question. Somehow, SBO HAS to fire this event (I cannot cancel it) becuase if try to cancel it (via bubbleevent=false), it will not let me set the field. I get the error mentioned above.

Also, the Validate event always has the BeforeAction=False. Some posts indicate that the bubbleevent=false will not work unless the BeforeAction=True, but I have found that it does work. I think the BeforeAction=True requirements for the bubbleevent=false is only for the MenuEvents.

Can someone clarify?

Carlos

barend_morkel2
Active Contributor
0 Kudos

Carlos,

If you don't want certain events to fire add filters to your application. Then you will only receive the events that you are interested in on your specific forms. thus if you only regiter the item_pressed event you will only get that event no Validate event or any other event will be fired. Here is an example of how to add filters:

Dim oFilters As SAPbouiCOM.EventFilters

Dim oFilter As SAPbouiCOM.EventFilter

oFilters = New SAPbouiCOM.EventFilters

oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)

' assign the form type on which the event would be processed

oFilter.Add(139) 'Orders Form

SBO_Application.SetFilter(oFilters)

'''-> now your app will only receive the ITEM_PRESSED event on the Sales Order form

Former Member
0 Kudos

Barend,

Thanks for trying to help, but this is not the issue. I know about filtering events in my own code.

I am trying to solve the aforementioned problem in order to block events in a different add on. I don't have access to the source code on this other add on, so I am trying to see if I can filter some events by blocking them via the "bubbleevent=false" in my own code.

Can someone that has experience doing this, please assist?

Carlos

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Carlos,

My apologies if I am missing something here, but for what you are trying to do, when an event is blocked, the application stops processing this event completely and the event is not bubbled to other add-ons.

Blocking events is available only when the events property BeforeAction=True by setting the event parameter BubbleEvent=False. If you are setting a filter on the et_Validate supposed to be used for. I referred you to the UI SDK HELP to look at the "Event Handling" as this documentation and diagram specifically shows what you are stating you are trying to handle. If you look at that documentation (probably you already have ), what part is not handling the issue you are having?

Again, my apologies if I missing something here, but this looks like what you are trying to do.

Eddy

Former Member
0 Kudos

Eddy,

I agree with your explanation of event handling and the bubbleevent=false. I also believe that it works even when the beforeaction=false for validate events (but that is anogther topic)

The problem that I am having is that I want to block the validate event from reaching other addons when I am updating sales prices on the sales order matrix. I cannot block the validate event, because if I set it to bubbleevent=false, the price will not update. I get a "Bad Form Value" error. Thus, I need to let this event go through for SBO's purposes, but I would like to block it from reaching other addons that are called subsequently.

My original question was:

Is there a way I can set the price on a sales order line item and at the same time block the validate event alltogether w/o getting the "Bad Form Value" error. This would solve my problem because then I can then block all events when I am updating the prices (thus blocking it for subsequent addons).

Carlos

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Carlos,

You should just set your add-on AFTER the one that is firing the event that you are trying to block (in the Add-on Administration) and then block the event with BubbleEvent = false when BeforeAction = True.

That should block it.

Hope this helps,

Eddy