Hi there.
Several things you need to mend (fixed code below)
- For State field which is a pickup, you need to use an EntityId value (not directly 'Active').
- For a sub-query you need to use the In operator ( not 'Equal').
- The QueryExpression type has a property named Query which holds the EntityQuery
Hope this helps,
Ophir
$qRightExpression = array (
"Value" => new SoapVar ( array ("TypeName" => "State", "Value" => "Active"), SOAP_ENC_OBJECT, "EntityId", "http://clarizen.com/api"));
$qExpression = array (
"LeftExpression" => new SoapVar ($qLeftExpression,SOAP_ENC_OBJECT, "FieldExpression", "http://clarizen.com/api/queries"),
"Operator" => "Equal",
"RightExpression" => new SoapVar ($qRightExpression,SOAP_ENC_OBJECT, "ConstantExpression","http://clarizen.com/api/queries"));
$qWhere = new SoapVar ($qExpression, SOAP_ENC_OBJECT, "Compare", "http://clarizen.com/api/queries");
//***********************************************************************************************************************************************
$query = array('TypeName' => 'Project', 'Where' => $qWhere);
$RightExpression = array ("Query" => new SoapVar ($query,SOAP_ENC_OBJECT, "EntityQuery","http://clarizen.com/api/queries"));
$Expression = array (
"LeftExpression" => new SoapVar ($LeftExpression,SOAP_ENC_OBJECT, "FieldExpression", "http://clarizen.com/api/queries"),
"Operator" => "In",
"RightExpression" => new SoapVar ($RightExpression,SOAP_ENC_OBJECT, "QueryExpression","http://clarizen.com/api/queries"));
$Where = array (new SoapVar ($Expression,SOAP_ENC_OBJECT, "Compare", "http://clarizen.com/api/queries"));