on 04-06-2006 6:49 PM
Hi !
I have a form made with Screen Painter and i put in it a check box. The field is binded to my UDO table. When i click on add in my form all the data are added in my UDO table and the values for my checkbox are Y or null in the Table.
My question is that i would like to catch an event when i click on add to print a message on screen when my check box is checked .
Can you help me with code please...
Thanks
I tried the code but it still doesnt work. all the data is correctly added to the table but no message on screen...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The main reason why i want to use the check box is to confirm that the client really wants to add that part of information in the table... So i have check the box so when he will click on add if the check box is checked it will add the data to the table... Maybe it explains more what i want todo with all this.. and maybe it will change the code...
Thanks for your time
Hi,
i found this code in the sdk documentation ....
'MessageBox return value (the index of the button pressed, 1 based).
Dim iReturnValue As Integer
iReturnValue = MessageBox("Do you want to continue?", 3, "&Yes!", "&No", "&Maybe")
Select Case iReturnValue
Case 1:
'continue
Case 2:
'abort
Case 3:
'Maybe pressed
End Select
Hi Alain
The above code should have worked, well here is some code, try the following
If (pVal.BeforeAction = False) Then
If (pVal.ItemUID = "SelAll") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim oCheckSellAll As SAPbouiCOM.CheckBox
oCheckSellAll = SBO_Application.Forms.Item(FormUID).Items.Item("SelAll").Specific
If (oCheckSellAll.Checked = True) Then sbo_Application.messagebox("hello")
End If
End If
SelAll is the combobox ID. The above code works perfect for me.
If you want a message box with a yes or no you must use something like
iReturnValue = SBO_Application.MessageBox("Are you sure you want to UFREEZE frozen Business Partners", 1, "&Yes!", "&No")
Then use the following to test his answer
Select Case iReturnValue
Case 1
UNFreeze_BP()
End Select
Select Case iReturnValue2
Case 1
freeze_BP()
End Select
Hope it helps
Hi Alain
Not a problem, i just scanned over the question and did not read in detail.
You'll use the same as i did above, except now we will enable the button instead of showing the message. For this to work the button should of been disabled. Now we can enable and disable a button as required, done it lots, but i haven't done it on a UDO primary button. So we will have to try. The code to enable the button is
If (pVal.BeforeAction = False) Then
If (pVal.ItemUID = "SelAll") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim oCheckSellAll As SAPbouiCOM.CheckBox
oCheckSellAll = SBO_Application.Forms.Item(FormUID).Items.Item("SelAll").Specific
If (oCheckSellAll.Checked = True) Then SBO_Application.Forms.Item("FormId").Items.Item("BtnID").Enabled = True
End If
End If
When the form loads you should ensure the buttons is not enabled, and is disabled.
Example
if pVal.FormTypeEx = "PF" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD Then
SBO_Application.Forms.Item("FormID").Items.Item("BtnID").Enabled = False
End If
Hope this helps
Hi,
try this in the itemevent :
if (pVal.ItemUID = "1" And pVal.BeforeAction = True and SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED = pVal.EventType) Then
Dim oForm As SAPbouiCOM.Form
Dim oItem As SAPbouiCOM.Item
Dim oCheckbox As SAPbouiCOM.CheckBox
oForm = oApplication.Forms.Item(pVal.FormUID)
oItem = oForm.Items.Item("checkbox")
oCheckbox = ctype(oItem.specific, SAPbouiCOM.CheckBox)
if (oCheckBox.checked) then
oApplication.MessageBox("Some message")
end if
end if
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
10 | |
9 | |
6 | |
3 | |
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.