on 09-15-2008 2:11 PM
Hi Experts,
I have a doubt regarding validation in the matrix....this is my coding for validating the column if the code is NULL.
Private Function ValidateTM(ByRef oForm As Form,
ByRef BubbleEvent As Boolean) As Boolean
Try
Dim oMatrix As Matrix
Dim oCode As EditText
Dim oName As EditText
Dim iCnt As Integer
oMatrix = oForm.Items.Item("3").Specific
For iCnt = 1 To oMatrix.RowCount - 1
oCode = oMatrix.Columns.Item("Code").Cells.Item(iCnt).Specific
oName = oMatrix.Columns.Item("Name").Cells.Item(iCnt).Specific
If oCode.Value = "" Then
oCode.Active = True
objSBO_Application_Mas.MessageBox("Row : " & iCnt.ToString & " Code is missing")
oMatrix.Columns.Item("Code").Cells.Item(iCnt).Click
(BoCellClickType.ct_Regular)
Return False
End If
If oName.Value = "" Then
oName.Active = True
objSBO_Application_Mas.MessageBox("Row : " & iCnt.ToString & " Name is missing")
oMatrix.Columns.Item("Name").Cells.Item(iCnt).Click
(BoCellClickType.ct_Regular)
Return False
End If
Next
Return True
Catch ex As Exception
objSBO_Application_Mas.MessageBox(ex.ToString)
Return False
End Try
End Function
In this coding all the validations works fine even in the
specific row when the column value is null it's pop
ups a message box that the field is NULL....
now my problem is suppose if *in the
CODE column the value is null,so when
i close(cancel) my form it shouldn't get
canceled...definitely the use should enter
some value......for this i think we have to
use BUBBLE EVENT=FALSE....but i
don't know where to use this bubble
event....* can anybody help me...
regards,
shangai.
Hi...
matrix load (values) u have to give
BubbleEvent = False
end of load
BubbleEvent = True
ur using validate event...
u have to give
pVal.InnerEvent = False
Regards..
Billa 2007
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi billa,
this is my coding....whether i have to use ur coding in Item Event or menu event....
Item Event
Private Sub objSBO_Application_Mas_ItemEvent(ByVal FormUID As String,
ByRef pVal As SAPbouiCOM.ItemEvent,
ByRef BubbleEvent As Boolean) Handles objSBO_Application_Mas.ItemEvent
Try
If pVal.Before_Action = True And pVal.EventType = BoEventTypes.et_CLICK And pVal.ItemUID = "1" Then
If pVal.FormTypeEx = "TM" Then
Dim oForm As Form
oForm = objSBO_Application_Mas.Forms.ActiveForm
BubbleEvent = ValidateTM(oForm)
End If
End if
End sub
Menu Event
Private Sub objSBO_Application_Mas_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent,
ByRef BubbleEvent As Boolean) Handles objSBO_Application_Mas.MenuEvent
If pVal.BeforeAction = False Then
Try
If pVal.MenuUID = "JB1" Then
Try
objSBO_Application_Mas.ActivateMenuItem(sTM)
Catch ex As Exception
End Try
End If
End If
End Sub
In this '2' Load Events where i have to set the bubble event
Regards,
shangai
Sorry if its not clear,
I did'nt see ur code properly, as ur using a boolean function i guess u can leave the boolean variable part,
I guess u need not use the blnValueCheck variable as it dosent have any use now as ur using a Boolean function.
Hope i'm clear now..??
Vasu Natari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure i'll help u.
In the Item event, in the Click of the Cancel button we write the code, it could be as follows,
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
If Pval.ItemUID = "2" and Pval.BeforeAction = True
If blnValueCheck = False 'This is a global boolean variable which will be made false if the value in the col is nul.
BubbleEvent = False
MsgBox("Value cannot be empty")
End If
End If
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.
hi vasu,
If pVal.Before_Action = True And pVal.EventType = BoEventTypes.et_CLICK And pVal.ItemUID = "2" Then
If pVal.FormTypeEx = "TRADE" Then
Dim oForm As Form
oForm = objSBO_Application_Mas.Forms.ActiveForm
BubbleEvent = ValidateTM(oForm)
If BubbleEvent = False Then
MsgBox("Value cannot be empty")
End If
End If
End If
For validating TM i have written above coding,it works fine....r else any other process is there????
regards,
shangai.
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
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.