$lookupKey = $WorkFlowReturnArray['InsertedID'];
$lookupCollection  = $this -> getCollection($CollectionID);

$lookupColumn = $lookupCollection[0]['LookupColumn'];
$lookupColumnName = $this->_getCollectionFieldName($CollectionID, $lookupColumn);

$lookupValue = $SubmittedData[$lookupColumnName];

$variableToEcho = '<script type="text/javascript">';

$variableToEcho .= 'var oo = window.parent.document.getElementById("'.$ExtraGetParams['fieldname'].'");';
$variableToEcho .= 'var objOption=window.parent.document.createElement("option");';
$variableToEcho .= 'objOption.innerHTML = "'.$lookupValue.'";';			
$variableToEcho .= 'objOption.value = "'.$lookupKey.'";';
$variableToEcho .= 'oo.appendChild(objOption);';		
$variableToEcho .= 'objOption.selected = "true";';
$variableToEcho .= 'window.parent.$("#'.$ExtraGetParams['dname'].$ExtraGetParams['fieldname'].'").dialog( "close" );';
$variableToEcho .= '</script>';

echo $variableToEcho;
die('');