Hello,
i need to retrieve a lead from its id, using the PHP Lead class. Here's what I've done so far :
content of test.php :
and using this URL :PHP Code:<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
require_once('include/entryPoint.php');
require_once 'modules/Leads/Lead.php';
$lead = new Lead();
$lead->retrieve($_GET["leadid"]);
echo 'retrieving '.$_GET["leadid"].'<br>';
foreach ($lead as $a => $b)
echo($a." : ".$b."<br>");
?>
https://mysugarcrm/test.php?leadid=260549b3-4cdc-4097-4199-4e5e2a510e42
with 2605[...]10e42 being the record id I want to retrieve, which I can find in a SugarCRM URL like this :
https://mysugarcrm/index.php?module=Leads&[...]&record=260549b3-4cdc-4097-4199-4e5e2a510e42
This code doesn't work, I get this :
all the fields being empty.Code:retrieveing 260549b3-4cdc-4097-4199-4e5e2a510e42 field_name_map : Array id : date_entered : [...]
Can someone tell me what I did wrong ?
By the way, can someone point me to the API documentation ? sugardev.net being down, I couldn't find another resource, and the developer guide available at sugarcrm.com doesn't help...
thanks !


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks