Looking up related values

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Looking up related values

Postby rochard » Fri Mar 26, 2004 5:44 pm

I have a mulltikey relationship that works perfectly. In the child file, I have 8 fields that have a related value set in dataproviders.properties. When the child record is created, I am expecting those values to be looked up and filled in but they are not. If, however, I perform a relookup
controller.relookup()
, the values appear instantly. What am I missing? TIA
Michael Rochard
rochard
 
Posts: 142
Joined: Thu Jan 29, 2004 12:11 am

Postby jcompagner » Fri Mar 26, 2004 6:43 pm

can you send a small example..?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

looking up related values

Postby rochard » Fri Mar 26, 2004 6:45 pm

The records in question where the values are not being entered are being created by means of the following method:
var day1 = utils.dateFormat(indate, 'D');
var day2 = utils.dateFormat(outdate, 'D');
var between = day2-day1;
for(var i = 0; i<between;i++)
{
tblreservationroom_to_nights.newRecord();
tblreservationroom_to_nights.reservationid=reservationid;
tblreservationroom_to_nights.roomassignid=roomassignid;
tblreservationroom_to_nights.lastname=lastname;
tblreservationroom_to_nights.firstname=name;
tblreservationroom_to_nights.roomsize=pricefield
var bookdate = indate;
bookdate.setDate(bookdate.getDate() + i);
tblreservationroom_to_nights.indate=bookdate;
}


What do I have to add to the above to get it to enter the related values? TIA
Michael Rochard
rochard
 
Posts: 142
Joined: Thu Jan 29, 2004 12:11 am

Postby jcompagner » Fri Mar 26, 2004 6:49 pm

which values?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

looking up related values

Postby rochard » Fri Mar 26, 2004 7:05 pm

jcompagner wrote:which values?


The values in question are 8 number fields; singleWD, singleWE, twinWD, twinWE, tripleWD, tripleWE, quadWD, quadWE. They come from a pricing table which is related to the secondary table using the roomassignID and the date. As I said, the values are correctly entered if I use
controller.relookup
but not when the records are created as part of the method. Thanks.
Michael Rochard
rochard
 
Posts: 142
Joined: Thu Jan 29, 2004 12:11 am

Postby jcompagner » Fri Mar 26, 2004 7:16 pm

please send me a small sample solution demonstrating this..
(else i always have to try to rebuild things from a description very time consuming and not maybe i am doing it still wrong)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 9 guests