Prasad,<br><br>Thank you for your reply. But if I correctly understant what you are saying the function &#39;custom_related_list&#39; I would create would filter the records shown in the related list.<br><br>The list that displays in more information tab (the related list) is NOT the one I want to filter.<br>

<br>I want to filter the content of the popup that shows when I click a button to select a record to add to that related list.<br><br>I want to make it easier for my users to find the record they want. And I want to make it impossible for them to select an unappropriate record.<br>

<br clear="all">David V.<br>
<br><br><div class="gmail_quote">On Fri, Jun 11, 2010 at 1:28 AM, Prasad <span dir="ltr">&lt;<a href="mailto:prasad@vtiger.com">prasad@vtiger.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi David,<br><br><span><span style="font-family: courier new,monospace;">function setRelatedList($moduleInstance, $label=&#39;&#39;, $actions=false, $function_name=&#39;get_related_list&#39;)</span><br></span><span style="font-family: monospace;"><br>


</span>In case you need to filter the records, I would suggest you to create a function &#39;custom_related_list&#39; in your module and<br>register it by passing the last argument to setRelatedList.<br><br>get_related_list function is made available through data/CRMEntity.php<br>


<br>Regards,<br>Prasad<br>vtiger Team<br><br><div><div><div></div><div class="h5"><span class="gmail_quote">On 6/11/10, <b class="gmail_sendername">David V.</b> &lt;<a href="http://davidv.net" target="_blank">davidv.net</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>&gt; wrote:</span></div>

</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
The setRelatedList API is extremely important for us who need to adapt Vtiger to specials requirements.<br><br>One question I still have is : is it possible to pre-filter the records in the windows that pops-up when I click Add on a related list ?<br>




<br>Exemple : I have a module Payslip. I want it to be related to the module Account so I can select Accounts to add to the More information tab of a specific Payslip.<br><br>I use the setRelatedList API as described in VtigerCRM_5.1.0_Vtlib.pdf and it works perfectly.<br>




<br>Now suppose that I want to show only a subset of the Accounts when I click on the Add button in the related list. For example I want to display only accounts from a specific city.<br><br>Is there already a way to do that ?<br>




<br>If not, would it be possible to add an other argument to the setRelatedList API ?<br><br>Vtiger_Module-&gt;setRelatedList(&lt;TARGET MODULE&gt;[, &lt;HEADER LABEL&gt;, &lt;ALLOWED ACTIONS&gt;, &lt;CALLBACK FUNCTION NAME&gt;, &lt;FILTER FUNCTION NAME&gt;]);<br>




<br>&lt;FILTER FUNCTION NAME&gt;<br>Optional (default = everything)<br>The function should be defined in the &lt;SOURCE MODULE&gt; class.<br>This should filter the records in the &lt;TARGET MODULE&gt; popup before displaying.<br>


<span>

<br><br clear="all">David V.<br>
</span><br></div></div>_______________________________________________<br>
Join vtiger community at <a href="http://forums.vtiger.com" target="_blank">http://forums.vtiger.com</a><br></blockquote></div><br>
<br>_______________________________________________<br>
Join vtiger community at <a href="http://forums.vtiger.com" target="_blank">http://forums.vtiger.com</a><br></blockquote></div><br>