<div dir="ltr"><div>Hi Nilay</div><div><br></div><div>You can use multiple queries for each reference field returned from main module response.  If you want to know how to write a custom web service method check below steps<br>
<ol><li> Add New file under "Include/Webservices/". Example if new 
method name is "retrieveproduct", file name should be RetrievProduct.php<br></li><li>Add function"vtws_retrieveproduct" under above file and write required code </li><li>Add a record in table vtiger_ws_operations and update sequence at vtiger_ws_operation_seq.</li><li>Also add parameters in table vtiger_ws_operation_parameters. Example<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:"times new roman",times,serif"><em>INSERT
 INTO `vtiger_ws_operation` (`operationid`, `name`, `handler_path`, 
`handler_method`, `type`, `prelogin`) VALUES ('34', 'retrieve', 
'include/Webservices/Retrieve.php', 'vtws_retrieve', 'GET', '0');</em></span><br><span style="font-family:"times new roman",times,serif"><em></em></span><br><span style="font-family:"times new roman",times,serif"><em>UPDATE `vtiger_ws_operation_seq` SET `id` = '34' WHERE `id` = '33';</em></span><br><span style="font-family:"times new roman",times,serif"><em></em></span><br><span style="font-family:"times new roman",times,serif"><em>INSERT INTO `vtiger_ws_operation_parameters` (`operationid`, `name`, `type`, `sequence`) VALUES ('34', 'id', 'String', '1'; </em></span></blockquote></li><li><span style="font-family:"times new roman",times,serif"><em>To enable mobile api, add a similiar file and function under "modules/Mobile/api/ws". Example "FetchProduct.php".</em></span></li><li><span style="font-family:"times new roman",times,serif"><em>Add
 the class like "Mobile_WS_FetchProduct" 5. Add an entry of above class 
under "modules/Mobile/api.php". Example 'fetchRecordsWithGrouping' =>
 array('file' => '/api/ws/FetchRecordsWithGrouping.php', 'class' 
=> 'Mobile_WS_FetchRecordsWithGrouping');</em></span></li></ol>

<br><br> below is a custom web service function which get all module language strings<br><a href="https://github.com/radus28/vtig_ws_language">https://github.com/radus28/vtig_ws_language</a></div><div><br></div><div>Thanks</div><div>Sutharsan Jeganathan<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 4, 2020 at 4:31 PM nilay khatri <<a href="mailto:nilay.spartan@gmail.com">nilay.spartan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Oh sorry, I replied too fast.<br><div><br></div><div>You have asked to get the user's info base don the assigned user id.</div><div><br></div><div>While resolving this for automateCRM, we though about 3 approaches:</div><div><br></div><div>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.</div><div>- This might cause some performance issues if you have many reference fields </div><div><br></div><div>2. for all reference and owner fields always return the display value along with the record id.</div><div>- good approach if you need only display labels. But might cause compatibility issues with existing apps consuming the existing rest api.</div><div><br></div><div>3. implement another webservice operation which would return basic info of all the accessible users/group to the currently logged in user. </div><div>- 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</div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 4, 2020 at 3:56 PM nilay khatri <<a href="mailto:nilay.spartan@gmail.com" target="_blank">nilay.spartan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hi Alan,<div dir="auto"><br></div><div dir="auto">We have implemented me api for the same.</div><div dir="auto"><br></div><div dir="auto">I guess I have a merge request on git as well for the same.</div><div dir="auto"><br></div><div dir="auto">Will share more details in sometime.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 3, 2020, 7:50 PM Alan Lord <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm working on another idea for a module and to work within the rules of <br>
the Marketplace I am trying to use the server API vtws_retrieve to get <br>
information about the assigned_user_id of a record to display in a <br>
different environment. I am using vtws_retrieve to get the data from the <br>
original record, but I can't do the same to get "display" data regarding <br>
the assigned user...<br>
<br>
If I try something like:<br>
<br>
> vtws_retrieve('19x22', $current_user) <br>
<br>
And I am that current user, e.g. id 22, then the call fails with <br>
"Permission to perform the operation is denied"<br>
<br>
All I actually want is to get some of the basic data like the display <br>
name (first_name + ' ' + last_name) and maybe their email/phone etc...<br>
<br>
But this seems to be not possible.<br>
<br>
What is the correct way to do this? I could, or course use a different <br>
user to make these calls i.e. Users::getActiveAdminUser(), but I am not <br>
sure if that would be permitted by the marketplace rules.<br>
<br>
PS: Also in many ways, it's a lot easier using things like the record <br>
models as they have built in methods like getDisplayName()...<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><font color="#9999ff"><i>Development Manager<br>
        Radus28 Software Solution<br>
        <img src="cid:part4.EAFD845F.485F57C8@radus28.com" title="www.radus28.com" alt="Radus28 Software Solution" width="205" height="60"><br>
        123, Level 2, Mc Larens Building<br>
        Baudhaloka Mw.<br>
        Colombo 04<br>
        Sri Lanka<br>
        M : +94773795291<br>
        E  : <a href="mailto:sutharsan@radus28.com" target="_blank">sutharsan@radus28.com</a><br>
        W : <a href="http://www.radus28.com" target="_blank">www.radus28.com</a></i></font></div></div>