I am working in the "after action event/ et_CLICK", after adding a new record (that is duplicated) very quickly it shows me the error of "DUPLICATE KEY", but the from is in OK_MODE.
how can I force to that after finding an error, be in UPDATE_MODE and NOT in OK_MODE.?
the parameter BubbleEvent, alone it works for the Before_action = True.
Thanks.
Jorge
Message was edited by: Jorge Benitez
Message was edited by: Jorge Benitez
Have you tried to set the value of the form Mode to Update in the After Action event?
form.Mode = fm_UPDATE_MODE
Trinidad.
You could update one of the fields on the form with it's own value to get Business One to put the form into Update mode. Basically, this is simulating a user keypress.
My approach would be to read the value from any one of the edit text fields on the form, then clear the field. Next would be to use Application.SendKeys to put the data back into the field. As a result, the form will be in update mode.
I think that this approach is more reliable than forcing the form into Update mode by modifying it's mode property directly, as I have run into some problems with form state when doing that.
Add a comment