Page 1 of 1

Valuelist populating more than one field

PostPosted: Thu Dec 06, 2007 9:25 am
by jstalin
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?

PostPosted: Thu Dec 06, 2007 11:46 am
by shannah
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.

PostPosted: Thu Dec 06, 2007 1:31 pm
by jstalin
Once again, that did it. Man, Dataface is awesome and you are awesome!!