开发者

Querying on Leads Status in SugarCRM Using NuSOAP

I'm trying to get back an entry list of leads by status. The query I'm using is "leads.status = 'New'" however when I try this in php, I get back leads of other statuses as well.

    function get_leads_over_x_days($session_id, $days)
    {
        $daysAgo = date("m/d/Y", strtotime($days . ' days ago'));

        $where = "leads.status='New'";

        $package = array(
                            "session" => $session_id,
                            "module_name" => "Leads",
                            "ids" => "",
                            "query" => $where,
                            "order_by" => "",
                          开发者_JS百科  "select_fields" => "",
                            "max_results" => $max_results,
                            "deleted" => 0,
                        );


        $result = $this->client->call("get_entry_list", $package);

        if (!$this->is_error($result)) {
            return $result["entry_list"];
        }
    }

Now I have performed the same soap call using SoapUI (http://www.soapui.org/) and the records returned are exactly what I expect. I'm not sure what I'm doing wrong, or if this is a nuSOAP issue.


I was able to run more or less the same query and get back the whole list...

$query = "leads.status = 'New'";
$result = $soapclient->call( 'get_entry_list',
                        array(
                            'session'=>$session_id,
                            'module_name'=>'Leads',
                            'query'=>$query, 
                            'order_by'=>'',
                            'offset'=>0,
                            'select_fields'=>array(),
                            'max_results'=>10
                        )
                    );

Can you show me a var_dump of the $result var following the call? Also try removing the

ids => ""

from your params and try the call again. That could be the root of the problem as usually if you specify an ID the call will try and fetch the corresponding entry.

Don't know how the plural form fits in here though. Worth a try with it removed.

Cheers, m^e

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜