Skip to Content
avatar image
Former Member

System form validation

I am new SAP B1 SDK but, many years programming.

I am trying to add some validation to Adding a Sales Order. I have got most of it figured out but exactly how to implement it.

What I have tried. I built a function to check the pertinate data but, I find if I try to override the save button's Before_Click function that I effectively bypass that entire function call.

I did get the desired effect by moving my function call to the Save button's PressedBefore event. However, is this the best/or only way of adding functionality to an event in SAP B1?

Ideally, I would like to take a button click event add to the process's before_click event and then let SAP B1 continue with it's button_click event.

Pretty simple function call:

Private Sub Button0_ClickBefore(sboObject As Object, pVal As SAPbouiCOM.SBOItemEventArg, ByRef BubbleEvent As Boolean) Handles Button0.ClickBefore
'Throw New System.NotImplementedException()
CheckDataSource() 'My function call
End Sub

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 21, 2017 at 05:18 AM

    Hi Joey,

    Refer to FormDataEvent under SDK Help Center and SDK Samples for the same. Here you can get bit information about it.

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 21, 2017 at 02:40 PM

    Depends on what you are validating I would use the SP_TransactionNotification, you won`t need any add-on running to validade it.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 21, 2017 at 09:45 AM

    Hi Joey,

    It's not recommended to use Click or Pressed (these can be bypassed especially if your using UDO's)

    Using the Before FormDataAddEvent will get you the behavior you are looking for.

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded