He estado probando email1en cuentas y contactos, cuando abro el sugarce en el contacto me dice no tiene emails.
Tambien he probado set_entry en las versiones 1,2, 2.1 y 3 y ninguna me da de alta el email.
No seria mas lógico poder dar de alta emails y luego hacer la relación?
He estado haciendo pruebas:
Con xml no funciona pero son soapclient de php si funciona.
Ejemplo en php que si funciona:
Code:
<?php
//user authentication array
$user_auth = array('user_name' => "xxx",'password' => MD5("xxxx"),'version' => ".01");
// connect to soap server
$client = new SoapClient('http://localhost/SugarCE/soap.php?wsdl');
// Login to SugarCRM
$response = $client->login($user_auth,"test");
$session = $response->id;
print "Session: $session\n";
# Now try to update a single array entry.
$entry = array(array("name" => 'id',"value" => 'cb66b549-c43f-1e23-d811-4d317554bea7'),
array("name" => 'email1',"value" => 'xxxx@xxxx.com') );
print "Set_entry with one item\n";
$result = $client->set_entry($session, 'Accounts', $entry);
print "Entry:\n";
print_r($entry);
print "Response:\n";
print_r($result); pero yo trabajo en XMLHTTP
Por tanto mi xml de envio es este. ( el identicador se sesión es correcto y el id de Cuentas tambíen)
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sug="http://www.sugarcrm.com/sugarcrm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<sug:set_entry soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<session xsi:type="xsd:string">cqspcc29q22cv8o1udpkmjc224</session>
<module_name xsi:type="xsd:string">Accounts</module_name>
<name_value_list soapenc:arrayType="sug:name_value[2]" xsi:type="sug:name_value_list">
<item xsi:type="tns:name_value">
<name xsi:type="xsd:string">id</name>
<value xsi:type="xsd:string">cb66b549-c43f-1e23-d811-4d317554bea7</value>
</item>
<item xsi:type="tns:name_value">
<name xsi:type="xsd:string">email1</name>
<value xsi:type="xsd:string">pxxxcxxxxxxx@aplitec.com </value>
</item>
</name_value_list>
</sug:set_entry>
</soapenv:Body>
</soapenv:Envelope>
Y este me devuelve:
Code:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.sugarcrm.com/sugarcrm">
<SOAP-ENV:Body>
<ns1:set_entryResponse xmlns:ns1="http://www.sugarcrm.com/sugarcrm">
<return xsi:type="tns:new_set_entry_result">
<id xsi:type="xsd:string">cb66b549-c43f-1e23-d811-4d317554bea7</id>
</return>
</ns1:set_entryResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> Pero no me da de alta el email.
Me podrias decir donde esta el fallo?
Muchas gracias.
Muchas gracias por la respuesta.
Pere.
Bookmarks