Page 1 of 1

Multi-line keys - how to ??

PostPosted: Wed Jan 21, 2004 10:06 am
by grahamg
Trying to show a foundset of records - after a search - in a portal using relationship based on PK of found records.

In FM can just copy all found record ID's into text field and use this as left side of relationship. However Servoy PK's are integer and I can't get relationship to work - do I need to have a second key that's text ??

Servoy usually has a feature thats easier than the workaround but I can't seem to find it on this one.

Suggestions please.

Thanks
Graham Greensall

PostPosted: Wed Jan 21, 2004 11:08 am
by jcompagner
to make sure that i understand you:
you want the search results of one form to be displayed in another form as a portal?
Why don't you use a tab that has no relation in that other form and set the results in that tab of the search.. (the form displayed in the tab can be a tableview so you have youre portal)

in RC3 you will be able to do a few more things with foundset like:

Code: Select all
global.markpk = yourefoundset ;

the pk's will be stored in the global, global can also be a record dataprovider so you can store them
and then back:
Code: Select all
var foundset = databaseManager.convertToDataSet(global.markpk);


but this has a limitation of around 200+ records (depending on database)

and you can convert one foundset to another f oundset with a relation (so going from one table to another table)

Code: Select all
var convertedFoundSet = databaseManager.convertFoundSet(foundset,contributions_to_people);
forms.peopleform.controller.showRecords(convertedFoundSet);

PostPosted: Wed Jan 21, 2004 1:29 pm
by grahamg
Johan

Thanks for reply. I am trying to ensure that after a user has been looking at other tables/databases they can return to the original record in the first database.

ie
- Have main Contacts form with tab-panel containing Notes & Table tabs all using 'Dataproviders' as source
- User selects a record from the Table tab and details show in main form and Notes tab

After looking at other tables/databases - Finance/Parts etc - they return to Contacts but the record being shown is the first one in the Table tab. I want it to be the record they were veiwing - which might be the 2nd/5th etc etc.

Tried a variety of relationships etc (digging an ever deeper hole !!) and thought that using a Portal might solve the problem.

Haven't been able to use rc1/rc2 on Mac due to screen refresh problems hope sorted on rc3.

Graham

PostPosted: Wed Jan 21, 2004 1:44 pm
by jcompagner
What do you mean with 'Dataproviders' as source?

Can't you make the Table tab a non related tab that just shows the foundset you want? And if you have other form that are also build on the same as the Table tab then make sure that the Table tab form has s seperate foundset...

then the foundset you have in the table tab will always keep the current set and the selection.. (if that is not the case then it is a bug, send over a solution that demonstrates that)

PostPosted: Wed Jan 21, 2004 2:42 pm
by grahamg
Dataproviders = selecting fields in Designer without using a specific relationship - just the option 'DataProvders for xxx' from the drop down list.

Found a post from DFehrenbach with reply from Bob Cusick - http://forum.servoy.com/viewtopic.php?t=1114 - which seems to be addressing similar problem.

Maybe Bob's comment on context is the clue to my problem. Will experiment some more.

Graham

PostPosted: Wed Feb 04, 2004 3:04 am
by mattman
Code: Select all
var convertedFoundSet = databaseManager.convertFoundSet(foundset,contributions_to_people);
forms.peopleform.controller.showRecords(convertedFoundSet);


So my question is this.

How do I currently show a related found set based on the current found set. It seems like the above code is going to do what I need but I have a found set of 5 records showing and I want to show a related found set where those 5 records may relate to many other records.

PostPosted: Wed Feb 11, 2004 4:08 pm
by Jan Blok
The code you are showing does exactly that, so I don't fully understand your question

convertFoundSet not working

PostPosted: Mon Mar 01, 2004 3:56 am
by chris
Jan Blok wrote:The code you are showing does exactly that, so I don't fully understand your question


As far as I can tell, this code does not actually do that. Pls see http://forum.servoy.com/viewtopic.php?t=1501

Thank you! Looking forward to this functionality.

PostPosted: Wed Mar 03, 2004 8:12 pm
by mattman
mattman wrote:
Code: Select all
var convertedFoundSet = databaseManager.convertFoundSet(foundset,contributions_to_people);
forms.peopleform.controller.showRecords(convertedFoundSet);


So my question is this.

How do I currently show a related found set based on the current found set. It seems like the above code is going to do what I need but I have a found set of 5 records showing and I want to show a related found set where those 5 records may relate to many other records.


I've recently tried using the convertFoundSet() function and I get the following.

On a form with two records and a valid relationship.

Code: Select all
application.output(foundset);


returns

Code: Select all
FoundSet[SIZE: 2,SELECTED RECORD: Record[COLUMS:subs_id,subs_mid,subs_signdate,subs_renewdate,subs_gid,  DATA: Row[DATA:107,1838,2004-03-02 00:00:00.622,2004-06-02 00:00:00.622,3,  CALCULATIONS: {}]]]


running this...

Code: Select all
var fs = databaseManager.convertFoundSet(foundset, mag_subs_to_mag_group_membership);
application.output(fs);


returns

Code: Select all
null


which precludes

Code: Select all
var fs = databaseManager.convertFoundSet(foundset, mag_subs_to_mag_group_membership);
forms.subsMemberships.controller.showRecords(fs);


from functioning properly. Please advise about this feature and how to get it to work. I have to create two hops to get back to a found set in Table 1 where I am coming from Table 3 and jumping to a found set in Table 2 and finally jumping to Table 1's found set.

PostPosted: Tue Mar 09, 2004 5:59 pm
by jcompagner
i need youre example because i have no idee how the relation is build.

is the relation something like:

mag_ubs.subs_id -> mag_group_membership.subs_id ??

then it should work fine.

PostPosted: Tue Mar 09, 2004 9:54 pm
by mattman
jcompagner wrote:i need youre example because i have no idee how the relation is build.

is the relation something like:

mag_ubs.subs_id -> mag_group_membership.subs_id ??

then it should work fine.


It will take me a while to get things together. I'll need to pare down the mysql db and I'll send you a whole package.