I have designed a form which is based on a certain table 'shipments’ so when the form loads, all the records in the shipments table are loaded into the tabpanel that I have placed on it. great… pretty beginner stuff.
however if I add code in my ‘onload’ section to limit out the display to only those records in the foundset that are … say for example - ‘active’ by adding the following code
… then everything is fine and works great. however if the user then switches to another (already exising form in my solution), and if that form is also based upon the same ‘shipments’ table then that form also filters on only ‘active’ records… which isn’t what I want as that form is supposed to list EVERY record in the shipments table.
Essentially I want to be able to do an addfoundsetfilterparam (or an addtablefilterparam) for only the data shown on the form in question rather then globally for any form using that shipments table.
Make sense?
Whats the best way to handle this? Any thoughts?
YEs, I was wondering if that was an option? but how do I do that?
I mean if we reduce this down to the most basic and simplest implementation, one where its a simple form with a tab panel or portal and no additional JS programming behind it, it obtains what table to select from based on the ‘dataprovider’ property of the form (which is the ‘shipments’ table) and it displays the data in the tab panel because the display fields have a data provider set to the column of that table.
So - its not actually specifying a specific foundset programatically. How do I force a custom/specific foundset that my new form will use?
ok. so i read up as best I could on the namedfoundset property and setting it to separate. I agree that it essentially tells the form not to use the default foundset and that a ‘named’ foundset will be used.
But I need a bit more detail as to how I code this in my onLoad() function.
Before you mentioned ‘namedfoundset’ I originally thought that I could code the following to
sql = "SELECT * from shipments where shipment_status = ‘active’ ";
var success = controller.loadRecords(sql,null);
but 2 issues
I get an error that ‘operand should contain 1 column’ (not sure why)
I now assume that this is just loading up the default foundset (I think) so it doesn’t really help me to avoid effecting other forms with my ‘status=active’ limitation. Correct?
So, what would I put in the onLoad to set this foundset up properly so my form displays only the ‘active’ rows?
and an additional question to my last post above…
3) how do I tell the form in my tabpanel to use the same foundset as the parent form (i.e the parent form being the form that I had specified -separate- for the namedfoundset property?
1+2 : select pk-id-fieldname from shipments where …
3 : two forms bound to the same table with separate foundsets are completely independent of each other regarding the records/rows within those foundsets.