is there ever a reason to use the controller.loadRecords() as opposed to the foundset.loadRecords().
The reason I ask, is that i think there is a servoy glitch or even bug with the controller. function.
This is I think related to calling it from a sub function on another form.
i.e
- Code: Select all
function a {
function b()
}
function b{
form2.controller.loadRecords(foundset.id);
... then do some stuff to print a pdf on form2.
}
We have found that sometimes the wrong record has been attached to an email we are sending when compiling a few attachments.
Recently it occurred after i had a script, which i decided to split out into 3 subscripts for ease of reading it, and this it appears started to cause a similar problem to that which I have seen before.
Anectdotally, it doesnt appear to be an issue when making the call from the first function on the form on which it is called, only when you go to a sub function on the same form. I have also checked the foundset.id and this is correct in the sub function, as another document, which uses it works fine within the same script.
I am hoping that using the form2.foundset.loadRecords(foundset.id), will work, and it appears to.
So is the controller.loadRecords function essentially not necessary as the founder. function will do the same thing, even if i use the controller.print in the next line?
A strange one!
David