cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Item Validation Event Fires Twice (sometimes)

former_member29412
Participant
0 Kudos
646

We've been experiencing some odd behavior with a few of our add-ons. Basically, for documents (Sales orders, quotes, purchase orders) the et_VALIDATE event is firing twice (once for inner event true and once for false) on the "Item" column in a matrix in some cases. The BeforeAction is being taken into account, so that's not the issue. Regardless of whether B1 should be doing that or not, I could handle it ok if it were consistent. It appears that in sales orders for example, the et_VALIDATE fires twice when the UDF form for the sales order is NOT open. When the UDF form is showing, the event fires only once (inner event = false). Additionally, if we use the choosefrom list to populate the item column, the validate event doesn't even occur at all. Quotes work in a similar way on some systems and purchasing seems to be ok for the most part.

Has anyone seen this before? I've validated this behavior on several machines, several databases and even used a sample add-on with nothing more than message boxes for the et_VALIDATE events. Here's the sample code:

Case "139"
                    Select Case pVal.BeforeAction
                        Case False
                            Select Case pVal.EventType
                                Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
                                    oOrderForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormTypeEx, pVal.FormTypeCount)
                                Case SAPbouiCOM.BoEventTypes.et_VALIDATE
                                    Select Case pVal.ItemUID
                                        Case "38"
                                            Select Case pVal.ColUID
                                                Case "1"
                                                    objMatrix = oOrderForm.Items.Item("38").Specific
                                                    ItemID = objMatrix.Columns.Item("1").Cells.Item(pVal.Row).Specific

                                                    If pVal.ColUID = "1" Then
                                                        SBO_Application.MessageBox("Sales: Inner = " & pVal.InnerEvent & " : " & ItemID.Value)
                                                    End If
                                            End Select
                                    End Select
                            End Select
                        Case True
                    End Select

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Curtis,

I tried to do this before, and I branched it with conditions of inner event.

I know the wired stuff, but I don't know why.

And I solved the problem with conditions of inner event.

Regards,

Hyunil Choi.

former_member29412
Participant
0 Kudos

I finally found a test database that didn't exhibit this weird behavior and was able to track it down to a formatted search on the "problem" database that I didn't realize existed. Anyway, when the final formatted search was deleted, the validation happened as it should. With the formatted search and the UDF form visible, is when the problems arose and validation wasn't ocurring as it should have been.

Answers (3)

Answers (3)

former_member29412
Participant
0 Kudos

Yeah, I tried it with formatted searches on and off with the same result. It's just so weird, especially considering I use this small sample add-on to test the behavior and it still does weird stuff.

Former Member
0 Kudos

Hi Curtis,

Do you have any formatted searches on any of these screens? I've seen the Validate event fire multiple times if there are formatted searches linked to fields on the screen.

Kind Regards,

Owen

andreea_stoica
Explorer
0 Kudos

Hi,

I got this behavior when on the form, there was not another field to receive the focus, after validating the value from the edit box. In other words, there was only one editable edit box. On lost focus, it was returning to the edit box.