Valuelist populating more than one field

A place for users and developers of the Xataface to discuss and receive support.

Valuelist populating more than one field

Postby jstalin » Thu Dec 06, 2007 9:25 am

I’m trying to get a form to populate the “date” field based on the “Order Number” that is chosen using data from a second table. I have the “order number” being chosen using a valuelists.ini file, but I can’t get it to populate the appropriate DATE based on the order number chosen. I need some help. Any suggestions?
jstalin
 
Posts: 7
Joined: Wed Dec 05, 2007 12:55 pm

Postby shannah » Thu Dec 06, 2007 11:46 am

An easy way to do this would be with a beforeInsert trigger.

Code: Select all
function beforeInsert(&$record){
    $orderNum = $record->val('orderNumber');
    $orderRecord =& df_get_record('Orders', array('orderNumber'=>'='.$orderNum);
    $record->setValue('date', $orderRecord->val('date'));
}


or something like this.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby jstalin » Thu Dec 06, 2007 1:31 pm

Once again, that did it. Man, Dataface is awesome and you are awesome!!
jstalin
 
Posts: 7
Joined: Wed Dec 05, 2007 12:55 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 28 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved