Hi All.
Newbie question ![Smile :)]()
I am trying to determine the best form properties on which to have a method invoked.
afaict, to get a method invoked when a record is loaded, set the property “onRecordSelection”.
But, what property should I configure to invoke a method on when I want to have the method fired whenever the user:
- navigates to another record
- switches to layout mode
- or somehow otherwise switches the record context
thanks
julian
- navigates to another record
onRecordSelection will also be fired for the next record the user navigates to.
a user cannot do that! that is only possible in developer.
- or somehow otherwise switches the record context
?? What do you exactly mean by “switches the record context”? There is an onHide event that will fire if you go to another form (and the current form is hidden).
The typical usage of form events is this:
onLoad: will be exectued once if the form is loaded for the first time. You can use that to generate value lists, populate globals and so on
onShow: will be executed every time the form is shown.
onRecordSelection: the user browses through records in that one form
onHide: you leave the form. You can use that for example to validate data in the last record the user browsed to
Hope this helps.
patrick:
- navigates to another record
onRecordSelection will also be fired for the next record the user navigates to.
a user cannot do that! that is only possible in developer.
Just curious (I’m a newbie) about this: What if the user switches to Find mode, performs a search and ends up on a different record? Would onHide work to run a method if the “record context is changed” by this means? (i.e., if the method had to run on the record being “left behind”).
Thanks, hope it’s not too dumb of a q.
If you search in the same form, why should onHide be fired (the form is still there)? But onRecordSelection will be fired for the record found.
patrick:
If you search in the same form, why should onHide be fired (the form is still there)? But onRecordSelection will be fired for the record found.
Thanks for that explanation, Patrick. Don’t answer if I’m being too much of a pain here (esp. since the original question was not mine, but I’m trying to learn everything I can as quickly as I can!) … but …
If the important thing is to run a method on the record being left behind (such as to validate that certain fields were filled in satisfactorily, for example), how would one do that if the user leaves the record by switching to Find mode and lands on a different record? Your answer seems to speak only to running the method on the newly-selected record, unless I’m just not gettng it.
Harriet
Hmm. You could try “onRecordSave”. I never use that, because I don’t allow direct searches in a form…