Multi-line keys - how to ??

Questions and answers for designing and implementing forms in Servoy

Multi-line keys - how to ??

Postby grahamg » Wed Jan 21, 2004 10:06 am

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
grahamg
 
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Postby jcompagner » Wed Jan 21, 2004 11:08 am

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);
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8844
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby grahamg » Wed Jan 21, 2004 1:29 pm

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
grahamg
 
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Postby jcompagner » Wed Jan 21, 2004 1:44 pm

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)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8844
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby grahamg » Wed Jan 21, 2004 2:42 pm

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
grahamg
 
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Postby mattman » Wed Feb 04, 2004 3:04 am

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.
Matt Petrowsky
mattman
 
Posts: 160
Joined: Wed Aug 06, 2003 8:23 am
Location: Murrieta, CA

Postby Jan Blok » Wed Feb 11, 2004 4:08 pm

The code you are showing does exactly that, so I don't fully understand your question
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

convertFoundSet not working

Postby chris » Mon Mar 01, 2004 3:56 am

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.
chris
 
Posts: 82
Joined: Wed Dec 31, 2003 8:24 pm

Postby mattman » Wed Mar 03, 2004 8:12 pm

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.
Matt Petrowsky
mattman
 
Posts: 160
Joined: Wed Aug 06, 2003 8:23 am
Location: Murrieta, CA

Postby jcompagner » Tue Mar 09, 2004 5:59 pm

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.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8844
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby mattman » Tue Mar 09, 2004 9:54 pm

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.
Matt Petrowsky
mattman
 
Posts: 160
Joined: Wed Aug 06, 2003 8:23 am
Location: Murrieta, CA


Return to Forms

Who is online

Users browsing this forum: No registered users and 9 guests