Valuelist populating more than one field

Archived from the Xataface Users forum.

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?


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.


jstalin — Thu Dec 06, 2007 1:31 pm

Once again, that did it. Man, Dataface is awesome and you are awesome!!