on 10-12-2008 6:08 AM
I want to make some fields mandatory in item master.
For this I am tracking the click event when the user clicks
on Update or Save button.I have displayed message
but I can not stop the execution of item master.
I want to stop its execution once the message
is displayed.After my message the item is getting updated
and message is displayed as
"Operation completed successfully"
I am using following code-
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Dim btnSave As SAPbouiCOM.Button
Dim txtUserText As SAPbouiCOM.EditText
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.Action_Success = True And pVal.FormType = "150" And pVal.ItemUID = "1" Then
objForm = SBO_Application.Forms.GetFormByTypeAndCount(150, 1)
btnSave = objForm.Items.Item("1").Specific
If btnSave.Caption = "Update" Then
txtUserText = objForm.Items.Item("79").Specific
If txtUserText.Value = "" Then
SBO_Application.StatusBar.SetText("Please enter User Text ", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
End If
End If
End If
End Sub
Hello,
Actually you don't need check the mandotary field and stop the execution in Update, the validation for mandotary field has better be done in event et_Validate.
'et_Validate handler of mandotary filed
If mandor_field= "" Then
MessageBox("Enter the text for**")
'Set the bubble event as false, thus the end user can leave the focus of the mandotary field
BubbleEvent = False
End If
Kind Regards
-Yatsea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you cannot save the item, set bubbleevent to false in your code or use transaction notification for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try the condition as
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.Before = True And pVal.FormType = "150" And pVal.ItemUID = "1" Then
I never used this type of actions in sbo (im using trsancation notfication), but I saw here in conference few threads that with adding or updating isnt the itemevent the right choice. Try the changed condition or search in history (how to prevent add)
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.