on 09-08-2014 2:15 PM
Hi experts,
i have a question regarding the ActionSuccess property in the ItemPressed Event.
When working with a UserForm and an Ok Button (ID = 1) then the ActionSuccess never gets true when pressing the Button when the UserForm is in Add-Mode.
Is this normal behaviour or a bug?
Thank you for your help
Matthias
Hi Matthias,
True and false.
The ActionSuccess property will be true if on the Item press of button 1 the form commit and action into the database and the data is committed successfully..
From the point of view :
1. If your user form is not based on UDO/System object, it will always return false.
2. If your user form is based on UDO/System Object, the return values will depend on whether the data is committed into table.
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Edy,
thank you for your answer!
Well, my user form is NOT based on UDO/System object.
So it will never return true on ActionSuccess?
How to handle the following problem then?
After the Button 1 was pressed and the addon has done its work i want to set the FormMode to "OK".
But when I do this, the form automatically gets closed.
Thanks again
Matthias
Hi Matthias,
was your form in add mode when you press the button?
after pressing in add mode does not automatically close the form. It would still open in add mode.
check if your code close the form.
or a work around would be process on before item press and set the bubble event =false to stop the event from continuing.
regards
edy
Hi Edy,
yes, the form was in add mode.
I'm in the ItemPressed Event, BeforeAction=true.
There the addon does it's work and after that I set the FormMode to OK.
This closes the form!
Why I'm in BeforeAction=true? Because i have to know if the form is in add mode or in update mode, because I do different things regarding to the form mode.
@Eric:
That's halfway true. B1 sets the FormMode to OK when the form was in update mode, but not, when the form was in the add mode.
Thank you
Matthias
Hi Matthias,
Sorry, but I'm not "halfway true". It means that something in your form definition or your code prevent B1 to correctly change the form's Mode
Saying this: may you check the AffectFormMode property of all items in the form and sets it to false (0 in the srf file) when it is not relevant (i.e; all buttons, all static text, the Matrix object, etc.)?
Regards,
Eric
Hi everyone,
Please excuse the intrusion, just wanted to suggest two things:
Have you disabled the form.AutoManaged? This will prevent B1 from managing the modes (note that you'll have to do it).
Can you change the id of the button (id 1 is a special Id telling B1 it's the "Add" button, same for Id 2 "Cancel")?
I'm only suggesting this because it seems you want to control the mode changing of the form yourself.
Hope it helps.
Good luck.
Best regards,
Pedro Magueija
Hi Matthias,
I'm in the ItemPressed Event, BeforeAction=true.
There the addon does it's work and after that I set the FormMode to OK.
This closes the form!
If you set the form mode to Ok in the before action = true, definitely it will close the form.
Set Bubbleevent = false
To stop the form from closing.
Or if you are using B1de, return false.
Regards
Edy
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.