This topic is locked
[SOLVED]

 How to get the value from a lookupwizard field

1/20/2010 4:23:03 AM
PHPRunner General questions
rjks author

Morning,
I want to send an email in the after edit/add events.

In my table are the link values for the lookupwizard, i.e. 1,2,3
the value I want to send is the name of the data with id 1 in this case name = open.
how can I get the same value as is displayed in the edit page?
Which wizard function can I use to get one value and not the whole selection list?
Another question

How can I just send the displayed fields in the edit page, the after add function sends all fields



foreach($values as $field=>$value)

{

if(!IsBinaryType(GetFieldType($field)))

$msg.= $field." : ".$value."\r\n";

}


This is a generall problem in the export print lists that the wizard link value is displayed and not the name value.
To get the correct language Label I use



$field_labels[$strTableName][$_SESSION["language"]][$field]


Which works fine.
thanks in advance for any help.
Robert

J
Jane 1/20/2010

Robert,
you can select name from lookup table using this code:

global $dal;

$rstmp = $dal->TableName->Query("LinkField=".$values["FieldName"],"");

$datatmp = db_fetch_array($rstmp);

$name = $datatmp["DisplayField"];


Then create email body manually:

$msg = "";

$msg.= "FieldName1 : ".$values["FieldName1"]."\r\n";

$msg.= "FieldName2 : ".$values["FieldName2"]."\r\n";

$msg.= "FieldName3 : ".$values["FieldName3"]."\r\n";

$msg.= "FieldName4 : ".$name."\r\n";