<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi <br></div><br></div>Here is some information about it .<br></div><br></div></div>1) <b>vtws_relatedtypes($elementType, $user)</b> <br> <br> This Api help us to retrieve the related module list .<br></div></div><br>Parameters : $elementType is a module name <br><div> $user is a user object <br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><b>ex : $result = vtws_relatedtypes("Contacts", $user);<br></b></blockquote><br>Returns a array of module which are related to contact module.<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Array<br>
(<br>
[types] => Array<br>
(<br></blockquote></div><blockquote><div> // related module list<br> )<br></div><div> [information] => Array<br>
(<br></div><div> // Related modules name , label ,the entity information<br></div><div> )<br>)<br></div></blockquote><div><br><br><b>2) vtws_retrieve_related($id, $relatedType, $relatedLabel, $user) </b><br></div><div> <br> This api help us to retrieve the related record information.<br> <br></div><div>Parameters : $id is combination of web service module id and record id <br></div><div> $relatedType is a related module name<br> $relatedLabel is a related module label (can be get from vtws_relatedtypes )<br> $user is a user object <br> <br></div><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><b>ex : $result = vtws_retrieve_related('4x64', 'HelpDesk', 'HelpDesk', $user);</b><br></blockquote> <br></div><div> This will return all Tickets which is related to the contact id =64 , where 4 is a webservice entity id (vtiger_ws_entity) <br><br></div><div><b> <br>3) vtws_query_related($query, $id, $relatedLabel, $user, $filterClause = null)<br> </b><br> <br> This api is same as <b> vtws_retrieve_related ,</b> in additional to it will accept the query to fetch the record.<br><br> <br><div>Parameters :<br> $query : Query need to be pass.<br> $id is combination of webservice module id and record id <br></div> $relatedLabel is a related module label (can be get from vtws_relatedtypes )<br> $user is a user object.<br><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div><b> ex : $result =vtws_query_related("SELECT * FROM HelpDesk WHERE ticket_title='helo ticket'", '4x64', 'HelpDesk', $user);</b><br></div></blockquote> <br>
This will return all Tickets with title = "helo ticket" which is
related to the contact id =64 , where 4 is a webservice entity id
(vtiger_ws_entity) .<br><br><br><br><br><br></div>Regards,<br></div>Manu Urs<br><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 21, 2015 at 5:01 PM, Alan Lord <span dir="ltr"><<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>></span> wrotprint_r($user);<br>die;e:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On 21/07/15 12:12, Christophe Humbert wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hello Alan,<br>
<br>
Indeed would be interesting to get some info...I imagine and to know if<br>
it will be included in vtwslib 1.?<br>
</blockquote>
<br></span>
Some tests:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
$relatedTypes = vtws_relatedtypes('Accounts',$current_user);<br>
</blockquote>
<br>
$relatedTypes contains a response like:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Array<br>
(<br>
[types] => Array<br>
(<br>
[0] => Contacts<br>
[1] => Potentials<br>
[2] => Quotes<br>
[3] => SalesOrder<br>
[4] => Invoice<br>
[5] => Calendar<br>
[6] => Emails<br>
[7] => Calendar<br>
[8] => Documents<br>
[9] => HelpDesk<br>
[10] => Products<br>
[11] => Campaigns<br>
[12] => Services<br>
[13] => PBXManager<br>
[14] => ServiceContracts<br>
[15] => Project<br>
[16] => Assets<br>
)<br>
<br>
[information] => Array<br>
(<br>
[Contacts] => Array<br>
(<br>
[name] => Contacts<br>
[label] => Contacts<br>
[isEntity] => 1<br>
)<br>
<br>
[Potentials] => Array<br>
(<br>
[name] => Potentials<br>
[label] => Potentials<br>
[isEntity] => 1<br>
)<br>
<br>
[Quotes] => Array<br>
(<br>
[name] => Quotes<br>
[label] => Quotes<br>
[isEntity] => 1<br>
)<br>
</blockquote>
...<br>
<br>
there is no information about the nature of the relationship. I'm not sure how useful this function could be really.<br>
<br>
The other function that appears to be designed to called is the vtws_retrieve_related function but I cannot get this to return anything useful:<br>
<br>
$typeInformation = vtws_retrieve_related('11', 'Contacts', 'Contacts', $current_user);<br>
<br>
returns:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Permission to perform the operation is denied for name<br>
</blockquote><div><div>
<br>
Al<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div>Regards,<br></div>Manu<br></div></div>
</div></div></div></div>