Hi,<div><br></div><div>Set $user=false by default in the vtws_sync definition should solve your problem.</div><div><br></div><div><div class="gmail_quote">On 25 July 2012 17:14, Ola Sikström <span dir="ltr"><<a href="mailto:ola.sikstrom@creativetools.se" target="_blank">ola.sikstrom@creativetools.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A little correction to the last mail:<br>
<br>
I do get different results based on if i'm admin or not - just not the<br>
expected result<br>
<br>
admin:<br>
returns entities owned by current user<br>
<br>
not admin:<br>
returns nothing at all (except for some php warnings): normal<br>
200-response, but no json-data<br>
<br>
<br>
2012/7/25 Ola Sikström <<a href="mailto:ola.sikstrom@creativetools.se" target="_blank">ola.sikstrom@creativetools.se</a>>:<br>
<div><div>> That sounds great indeed, but unfortunately I can't get it to work.<br>
><br>
> I actually see no difference to the result at all, if i pass<br>
> syncType=application.<br>
><br>
> I can see in the code for vtws_sync that it should throw an<br>
> ACCESS_DENIED error if I am not an administrator. Even though i am not<br>
> an administrator i do not get this error, but I still don't get any<br>
> data other than my own.<br>
><br>
> I have tried using an admin account as well, but get the same results.<br>
><br>
> I did submit a bug report on this, as you may have seen:<br>
> <a href="http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7456" target="_blank">http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7456</a>, although I think<br>
> I understand the problem a bit better now. I suspect this is related<br>
> to a php-warning, as mentioned in the bug report:<br>
> Warning: Missing argument 4 for vtws_sync() in<br>
> /mnt/data/www/html/vtigercrm-5.4.0/include/Webservices/GetUpdates.php<br>
> on line 14<br>
><br>
> This indicates that the user is not passed to the function at all.<br>
> Either that, or the user is passed as the third argument, which is in<br>
> fact $syncType.<br>
><br>
> This piece of code, from vtws_sync, strenghtens my belief that this is<br>
> the case, ie user is passed in place of the syncType argument, and<br>
> user is left empty.<br>
><br>
> $applicationSync = false;<br>
> if(is_object($syncType) && ($syncType instanceof Users)){<br>
> $user = $syncType;<br>
> } else if($syncType == 'application'){<br>
> $applicationSync = true;<br>
> }<br>
><br>
> This means that the syncType argument never gets passed to vtws_sync.<br>
> If you want my opinion, the problem that the above snippet tries to<br>
> solve should have been solve in the calling function. This just makes<br>
> obscure code in my opinion.<br>
><br>
> Is this perhaps fixed already in the development branch? If you have<br>
> any fixes for this, would it be possible to get a patch?<br>
><br>
> 2012/7/25 Vikas Jain <<a href="mailto:vikas@vtiger.com" target="_blank">vikas@vtiger.com</a>>:<br>
>> Hi,<br>
>><br>
>> You can use vtws_sync for synchronizing entities across the application. In<br>
>> 5.4.0 we have added another parameter 'syncType'<br>
>> which lets you control the type of synchronization i.e. user level or<br>
>> application level. Pass value as 'application' to this parameter.<br>
>> I apologize for not updating the wiki document. Let us know if this helps<br>
>> you.<br>
>><br>
>> On 25 July 2012 01:50, Ola Sikström <<a href="mailto:ola.sikstrom@creativetools.se" target="_blank">ola.sikstrom@creativetools.se</a>> wrote:<br>
>>><br>
>>> The sync-function only reports entities owned by the current user. I<br>
>>> think the best bet is to make a custom sync function, based on the<br>
>>> query function, and filter by modification date like Adam wrote.<br>
>>><br>
>>> I have already investigated this a bit, since I have similar plans<br>
>>> (i.e. syncing data with other applications).<br>
>>><br>
>>> 2012/7/24 Alan Lord (News) <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>>:<br>
>>> > On 24/07/12 05:40, ram prasad wrote:<br>
>>> >><br>
>>> >> Please provide suggestions to start sync local database in mobile with<br>
>>> >> the Vtiger mysql database.<br>
>>> ><br>
>>> > How about using the sync function in the webservices API?<br>
>>> ><br>
>>> > <a href="https://wiki.vtiger.com/index.php/Webservices_tutorials#Sync" target="_blank">https://wiki.vtiger.com/index.php/Webservices_tutorials#Sync</a><br>
>>> ><br>
>>> > HTH<br>
>>> ><br>
>>> > Al<br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > --<br>
>>> > Libertus Solutions<br>
>>> > <a href="http://www.libertus.co.uk" target="_blank">http://www.libertus.co.uk</a><br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > <a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Ola Sikström<br>
>>> Creative Tools AB<br>
>>><br>
>>> _______________________________________________<br>
>>> <a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Regards<br>
>> Vikas<br>
>> Vtiger Team<br>
>><br>
>> _______________________________________________<br>
>> <a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
><br>
><br>
><br>
> --<br>
> Ola Sikström<br>
> Creative Tools AB<br>
<br>
<br>
<br>
--<br>
Ola Sikström<br>
Creative Tools AB<br>
</div></div>035-77 77 893<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards<br>Vikas<br>Vtiger Team<br>
</div>