<div dir="ltr"><div><div><div><div>Hello All<br><br></div>I have used a lot of functions to be sure of the Group Id etc...<br><?php<br>$file = realpath('vtwsclib');<br>include_once $file.'/Vtiger/WSClient.php';<br>$url = '<a href="https://www.lib-assur.com/vtiger">https://www.lib-assur.com/vtiger</a>';<br>$client = new Vtiger_WSClient($url);<br>$login = $client->doLogin('user', 'key');<br>if(!$login) echo 'Login Failed';<br>else {<br>    /*echo "Session: : ".$client->sessionId;<br>    $modules = $client->doListTypes();<br>    $c=1;<br>    foreach($modules as $modulename => $moduleinfo) {<br>        echo "ModuleName: ".$modulename." ".$c."\n<BR>";<br>        $c++;<br>    }<br><br>    $module = 'Groups';<br>    $describe = $client->doDescribe($module);<br>    $fields = $describe[fields];<br>    for($i=0; $i<count($fields); $i++) {<br>        echo $fields[$i]['name']."</br>";<br>    }*/<br>    // Retrieve Groups <br>    $query = "SELECT * FROM Groups WHERE groupname LIKE 'Team%'";<br>    $records = $client->doQuery($query);<br>    if($records) {<br>        //$columns = $client->getResultColumns($records);<br>        foreach($records as $record) {<br>            $groupid = $record['id'];<br>            // Process record information<br>            /*foreach($columns as $column)<br>                echo $column."<br>";*/<br>        }<br>    }<br><br>    $record = $client->doCreate($module, Array('lastname'=>'Test_LS1', 'company'=>'Test1', 'assigned_user_id'=>$groupid));<br>    if($record) {<br>        echo "done";<br>        //$recordid = $client->getRecordId($record['id']);<br>        //echo "Record ".$recordid;<br>    } <br>    else {<br>        $wasError= $client->lastError();<br>        if($wasError) {<br>            echo "</br>last error : ".$wasError['code'] . ':' . $wasError['message'];<br>        }<br><br>    }<br>}    <br>?><br><br></div>That is working if I don't try to doCreate with assigned_user_id but as soon as i use this in do create I have the following error<br> ACCESS_DENIED:Permission to perform the operation is denied
<br><br></div>and the user I am using is admin...a bug or something...<br><br></div>Thanks for any hint<br><div><div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Christophe Humbert<br><br></div></div>
<br><div class="gmail_quote">On Tue, Jun 16, 2015 at 9:22 AM, Christophe Humbert <span dir="ltr"><<a href="mailto:chrissc.humbert@gmail.com" target="_blank">chrissc.humbert@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello Estevan<br><br></div>I am using the doCreate method but what I can have wrong is the Entity Id of Group on vtiger 6.2 I thought it was 28...because when assigning with user it is working...<br><br></div><div>PS: how do you use the debug method, sorry for stupid question but I am not a dev.<br><br></div><div>Thanks for your valuable help<span class="HOEnZb"><font color="#888888"><br></font></span></div><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div>Christophe Humbert<br><br><br></div></div></font></span><div><div class="h5">
<br><div class="gmail_quote">On Tue, Jun 16, 2015 at 6:29 AM, estevan <span dir="ltr"><<a href="mailto:estefan.civera@gmail.com" target="_blank">estefan.civera@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">try with vtws_create and debug it to discover why it fails, then come back<br>
and use web service doCreate method<br>
<span><br>
<br>
<br>
<br>
<br>
-----<br>
Ing. Estefan Civera<br>
Vtiger developer and consultant<br>
<a href="http://www.estefancivera.net" rel="noreferrer" target="_blank">http://www.estefancivera.net</a><br>
Italy<br>
--<br>
</span>View this message in context: <a href="http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-Create-a-Lead-in-Web-service-using-vtwsclib-1-5-tp16558p16580.html" rel="noreferrer" target="_blank">http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-Create-a-Lead-in-Web-service-using-vtwsclib-1-5-tp16558p16580.html</a><br>
<div><div>Sent from the vtigercrm-developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>