Check Box in UDO Form
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
Louis de Gouveia replied
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