<div dir="ltr"><div><div><div><div><div><div>Hello Guys<br><br></div>I have a small issue with convert lead web services<br><br></div>The retrieve information are OK no issue<br><br></div>But I have access denied each time I am trying t convert lead...(exact message is ACCESS_DENIED:Permission to perform the operation is denied for id)<br><br></div>So i tried as you have seen below with user which is admin for the assigned_user_id....<br><br></div>So if anyone as an idea on how to solve that<br><br></div>Vtiger 6.2<br><div><div><div><div><div><div><div><br>$recordInfo = $client->doRetrieve($id);<br> echo 'show: ' .$recordInfo['assigned_user_id'];<br> $convert_lead_array = array();<br> $convert_lead_array['leadId'] = $recordInfo['id'];<br> //$convert_lead_array['assignedTo'] = $recordInfo['assigned_user_id'];<br> $convert_lead_array['assignedTo'] = '19x5';<br> $convert_lead_array['entities']['Accounts']['create']=true;<br> $convert_lead_array['entities']['Accounts']['name']='Accounts';<br> $convert_lead_array['entities']['Accounts']['accountname'] = $recordInfo['company'];<br> $convert_lead_array['entities']['Accounts']['industry']=$recordInfo['industry'];<br> $convert_lead_array['entities']['Potentials']['create']=true;<br> $convert_lead_array['entities']['Potentials']['name']='Potentials';<br> $convert_lead_array['entities']['Potentials']['potentialname']=$recordInfo['company'];<br> //$convert_lead_array['entities']['Potentials']['closingdate']= date("Y-m-d", strtotime("+1 week Saturday"));<br> $convert_lead_array['entities']['Potentials']['sales_stage']= 'Subscription requested';<br> $convert_lead_array['entities']['Potentials']['amount']= 0;<br> $convert_lead_array['entities']['Contacts']['create']=true;<br> $convert_lead_array['entities']['Contacts']['name']='Contacts';<br> $convert_lead_array['entities']['Contacts']['lastname']=$recordInfo['lastname'];<br> $convert_lead_array['entities']['Contacts']['firstname']=$recordInfo['firstname'];<br> $convert_lead_array['entities']['Contacts']['email']=$recordInfo['email'];<br> //Encode in json for the webservice consumption<br> $convert_lead_json = json_encode($convert_lead_array);<br> $response = $client->doInvoke('convertlead', array('element'=>$convert_lead_json));<br> $wasError = $client->lastError();<br> if($wasError) {<br> return $wasError['code'] . ':' . $wasError['message'];<br> } else {<br> return 1;<br> }<br clear="all"><div><div><div><div class="gmail_signature"><div dir="ltr"><div><br></div><div>Thanks<br></div><div><br>Christophe Humbert<br><br></div></div></div></div>
</div></div></div></div></div></div></div></div></div></div>