on 2010 Mar 29 3:05 PM
Hello,
I would like to stop processing events if some condition occurs.
I have matrix object and I would like to not update the db if this matrix contains data that is not valid upon pressing update button.
Currently I put my validation logic in OnFormDataUpdateBefore. If it returns error I set bubble event to false so it stops further processing (specifically it won't fire OnFormDataUpdateAfter where I presume data is persisted into db)
The problem is that with bubble event set to false I got some "internal error occured" error.
What happened?
Thanks in advance
Kamil
Request clarification before answering.
Kamil,
Or try with the Item Press event and check if u are getting the same error?
Hope it helps,
Vasu Natari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vasu.
I could put it OnItemPressed event but it won't stop FormDataEvent from being fired. My goal here is to not updating db with invalid data. I could also change the data in code so it will become valid but I don't want to do that. I want the user to make necessary changes.
Or maybe there another way to achieve what I want? Again top priority for me is to not updating DB with invalid (from bussiness logic) data when user presses update button.
Thanks
Kamil
Hi
i think form data add/update event is the right thing to handle this. you can try like below
If pVal.FormTypeEx = "140" And pVal.BeforeAction = True Then
If pVal.ItemUID = "1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then
If validate(pval) Then
BubbleEvent = True
Else
BubbleEvent = False
End If
end if
end if
Private Function validate(ByVal pval As SAPbouiCOM.ItemEvent) As Boolean
'insert your code here
return true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
39 | |
8 | |
6 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.