Anwar Ahmat - 2015-03-20

Hi guys,

In the first step, I create new data model as "single_check" ; and I add new class "lnkconfigurationitemtosinglecheck" to link the "sinlge_check" item to "FunctionalCI" item ; I have successfully created new singl_check item with the "single_check" model, and I can link the configuration items with the new data model; now there is data in "single_check" and "lnkconfigurationitemtosinglecheck" table;

In the second step , I wrote some codes betweeb <methods> </methods> in my datamodel.single_check.xml file. my code is as follows :

<methods>
<method id="user-content-GetRelationQueries">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<![CDATA[ public static function GetRelationQueries($sRelCode)
{
switch ($sRelCode)
{
case "depends on":
$aRels = array(
"solution" => array("sQuery"=>"select FunctionalCI as ci join lnkconfigurationitemtosinglecheck as lk on lk.config_item_id = ci.id where lk.single_check_id = :this->id", "bPropagate"=>true, "iDistance"=>2),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
</method></methods>

                    default:
                    return parent::GetRelationQueries($sRelCode);           
                }
            }]]></code>
        </method>
  </methods>

but, after updating code with datamodel Toolkit, when I click the "depends on" in the newly created single_check page, there is fatal error message; the error message is as follows:

Error: Unexpected token NAME, found 'FunctionalCI' in: select FunctionalCI as ci join lnkconfigurationitemtosinglecheck as lk on lk.config_item_id = ci.id where lk.single_check_id = :this->id.

How can I modify my code , please ?

Thanks a lot !