[Vtigercrm-developers] How to use server api to get information about assigned user, like their name?

nilay khatri nilay.spartan at gmail.com
Sat Apr 4 11:00:22 GMT 2020


Oh sorry, I replied too fast.

You have asked to get the user's info base don the assigned user id.

While resolving this for automateCRM, we though about 3 approaches:

1. add another parameter to operations such as retrieve, query, if set as
true, then it also returns the related record's (reference/owner) data as a
sub array. For users and groups it returns only basic info like name,role,
calendar settings etc.
- This might cause some performance issues if you have many reference
fields

2. for all reference and owner fields always return the display value along
with the record id.
- good approach if you need only display labels. But might cause
compatibility issues with existing apps consuming the existing rest api.

3. implement another webservice operation which would return basic info of
all the accessible users/group to the currently logged in user.
- might cause issues if you are caching the fetched data, as the accessible
users/group can change anytime. But, still you need to make separate calls
to fetch label values for reference fields and the custom api anyways





On Sat, Apr 4, 2020 at 3:56 PM nilay khatri <nilay.spartan at gmail.com> wrote:

> Hi Alan,
>
> We have implemented me api for the same.
>
> I guess I have a merge request on git as well for the same.
>
> Will share more details in sometime.
>
> On Fri, Apr 3, 2020, 7:50 PM Alan Lord <alanslists at gmail.com> wrote:
>
>> I'm working on another idea for a module and to work within the rules of
>> the Marketplace I am trying to use the server API vtws_retrieve to get
>> information about the assigned_user_id of a record to display in a
>> different environment. I am using vtws_retrieve to get the data from the
>> original record, but I can't do the same to get "display" data regarding
>> the assigned user...
>>
>> If I try something like:
>>
>> > vtws_retrieve('19x22', $current_user)
>>
>> And I am that current user, e.g. id 22, then the call fails with
>> "Permission to perform the operation is denied"
>>
>> All I actually want is to get some of the basic data like the display
>> name (first_name + ' ' + last_name) and maybe their email/phone etc...
>>
>> But this seems to be not possible.
>>
>> What is the correct way to do this? I could, or course use a different
>> user to make these calls i.e. Users::getActiveAdminUser(), but I am not
>> sure if that would be permitted by the marketplace rules.
>>
>> PS: Also in many ways, it's a lot easier using things like the record
>> models as they have built in methods like getDisplayName()...
>>
>> _______________________________________________
>> http://www.vtiger.com/
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20200404/32216d3c/attachment.html>


More information about the vtigercrm-developers mailing list