cancel
Showing results for 
Search instead for 
Did you mean: 

UDO how to cancel Update button

Former Member
0 Kudos

Hi !

I'm using UDO and i would like to update manually some fields instead of the automatic Update with UDO's form ... Can i Catch this event and cancel the automatic updates to the table From UDO????

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member184566
Active Contributor
0 Kudos

Hi Alain

You should be able to catch the event in the itemevent. Try catching when the button is pressed (ItemPressed), obviuolsy before the action, then bubble the event.

Hope this helps.

Former Member
0 Kudos

Hi Master Louis !!!!!

If you have the time could you please show me with the code ???

I'm always mixing bubble event with before_action. This could be a good reference for me in the future... Thanks

Former Member
0 Kudos

Hi Alain,

In your code you should get the event that was triggered and check whether it was the add button that was clicked. Then you do your code and then set the BubbleEvent parameter to false to not execute the standard processing of SAP Business One. Code sample:

If pVal.BeforeAction = True Then
   If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then
      If pVal.ItemUID = "1" Then
         oForm = oApplication.Forms.ActiveForm
         ...
         'Do your code and saving
         BubbleEvent = False
      End If
   End If 
End If

Hope it helps,

Adele

former_member184566
Active Contributor
0 Kudos

Hi Alain

Adele is 100% correct as usual Use the sample code, it will work. But if i was you i'd rather let the UDO do the update. Do all the work just before the form is added (calculations) and place them on the form. Think about....hide fields (not visible or width -10) that are linked to the udo tables, catch the add button, freeze the form and make the changes and place the values in hidden fields, unfreeze once you are done. Like this the udo makes the changes.

Hope this helps

Former Member
0 Kudos

Well thanks again to you both !!

Masters of all !!!!

Answers (0)