I have two forms that see the same table and therefore basically see the same information. When I do a search and get a foundset in one form, I thought you could switch to the other form and the same foundset was kept since it is looking at the same table. Is that not correct? Is there something special I have to do to keep the foundset while switching from one form to another?
Jim, You should check that ‘useSeperateFoundset’ is not checked but:
I always ‘move’ around foundsets with controller.loadRecords(foundset) to be in full control.
Maybe you have changed the foundset at one point and, after that, the ‘connection’ is lost.
Hi Jim,
Maybe you are looking at the first form through a relation, then the form also gets a separate foundset
I am still having problems with a founset not pulling thru from one form to the other. Here are the two methods I tried.
forms.ycm_coord.controller.showRecords(foundset);
and
forms.ycm_coord.controller.loadRecords(foundset);
forms.ycm_coord.controller.show();
Neither of these worked correctely. They both will give me all of the records and not just the found set.
And you are sure they are based on the same server/table
Sorry, I have been away from this problem for quite a while.
So to answer your question, yes the two forms in question both look to the same table.
If I view the two forms separately, and then run my script it works correctly. If I run it from the first form without viewing the second form ahead of time, it does not work.
It’s like there is no connection between the two forms. Do I have to ‘touch’ both forms at the beginning of the session so that they are ‘connected’? That seem weird and would create unnecessary code.
If you take a foundset from a form and call controller.loadRecords(foundset) on the other form, this should always work. If you have a case where it does not, you should post that to the support system, I think.
So, you are saying it should work if I write it like this:
forms.layout2.controller.showRecords(forms.layout1.foundset);
Is this correct? Maybe I have the syntax wrong?
That should work.
Unfortunately it did not work. The method is activated from a button on the form named ‘Coord_Main’.
Below is my code:
var choose = plugins.dialogs.showSelectDialog( "Choose Report", "Please choose from the list of reports.", 'Shot Status', 'Extended One Liner', 'Shot Notes', 'Screening Log', 'Accounting One-Line', 'Finals List', 'Client List');
switch( choose )
{
case 'Shot Status': forms.coord_shot_status.controller.showRecords(forms.Coord_Main.foundset);
break;
case 'Extended One Liner': forms.coord_extended_one_liner.controller.showRecords(forms.Coord_Main.foundset);
break;
case 'Shot Notes': forms.coord_shot_note.controller.showRecords(forms.Coord_Main.foundset);
break;
case 'Screening Log': forms.coord_screening_log.controller.showRecords(forms.Coord_Main.foundset);
break;
case 'Accounting One-Line': forms.coord_accounting_one_line.controller.showRecords(forms.Coord_Main.foundset);
break;
case 'Finals List': forms.coord_finals_list.controller.showRecords(forms.Coord_Main.foundset);
break;
case 'Client List': forms.full_shot_list.controller.showRecords(forms.Coord_Main.foundset);
break;
default: break;
}
When I run this method, it switches to the form called, but gives me all of the records.
Is this a bug or am I doing something wrong?
You must be doing something wrong, loading the data in another way in another method maybe.
I can not believe this is a bug, it is core functionality.
What does the onShow method of the form you go to do? Couldn’t you just debug a bit and see what goes on in the debugger (for example by evaluating the foundset of the target form before and after and so forth)?
I’d check the onLoad and onShow of the form you’re displaying to see if you override the foundset in any way.
Paul
onShow is blank.
onLoad has a method that it activates to only show “ACTIVE” records.
controller.addFoundSetFilterParam('status', '=', 'ACTIVE');
controller.loadRecords();
Both layouts have the exact same setup with the same method onLoad. and nothing in onShow.
That’s it.
I don’t understand. From the feedback I have recieved, my method should work.
BTW, thanks guys for all of your great input.
So, any other ideas?
create a sample so we can look at it…