<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarai.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to filter on related fields using Filter API</title><link>/dev-club/b/dev-blog/posts/how-to-filter-on-related-fields-using-filter-api</link><description>This post originally appeared on the SynoLab blog hosted by Synolia , an Elite SugarCRM Partner. Yann Berg&amp;egrave;s describes how you can use a relate filter with the Filter API. He also explores how Sugar does it as well as identifying a d...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to filter on related fields using Filter API</title><link>https://sugarclub.sugarai.com/dev-club/b/dev-blog/posts/how-to-filter-on-related-fields-using-filter-api</link><pubDate>Thu, 30 Aug 2018 11:20:06 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:80b12685-b60a-4a16-b54b-5bdc2c835980</guid><dc:creator>brad foster</dc:creator><slash:comments>0</slash:comments><description>
&lt;p&gt;I&amp;#39;m running into a problem and i&amp;#39;ve traced it back to this.&lt;/p&gt;&lt;p&gt;When calling the Contacts api with max_num set to 20, it was only returning 10 records. After reviewing the query it&amp;#39;s joining the &amp;quot;tag_bean_rel&amp;quot; table and because the contacts have 2&amp;nbsp; tags, its returning 10 distinct contacts (2 rows for each).&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;The fixQuery isn&amp;#39;t working. although it is passing through it. (perhaps because we are using MSSQL?)&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The fix for me was to simply specify the fields in the request so that it doesnt join all related tables. (luckily i dont need the tags anyway)&lt;/p&gt;&lt;p&gt;&lt;span&gt;/Contacts?fields=id,full_name,customer_number,membership_type,date_modified&amp;amp;offset=0&amp;amp;max_num=20&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;This also gives a massive performance boost so I suggest you specify your fields anyway - even if you don&amp;#39;t have a duplicate problem.&lt;/span&gt;&lt;/p&gt;
&lt;img src="https://sugarclub.sugarai.com/aggbug?PostID=804&amp;AppID=56&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>