cancel
Showing results for 
Search instead for 
Did you mean: 

System form validation

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member233854
Active Contributor
0 Kudos

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

pedro_magueija
Active Contributor
0 Kudos

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

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

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