AnsweredAssumed Answered

filter in popupview to use a related parent id

Question asked by Doddy Amijaya on Jun 2, 2016
Latest reply on Jun 16, 2016 by Doddy Amijaya

I have researched this topic long enough before I make this post.

Basically what I need to do is override the query in the popup view so that users only presented by record that's related to the parent.

 

for exampe,

I have custom module called vendor. on the call module I add a related field to Vendor.

The account has 1-M relationship with Vendor.

from Account X i want to create a new call record and in that screen I can associate this call with a Vendor.

when I click the arrow button a pop up appear but it's listed the whole vendor in the system

 

what I want to achieve is that only show Vendor that's related to the account instead of all Vendor.

 

I tried the initial_filter route but i am stuck when trying to do a sub query to grab all vendor that's related to that account.

it looks like initial_filter won't allow sub query. I also tried changing the WhereClauses in the popupdefs.php but no luck.

I tried the on before_filter logic hooks to hijack the sugarQuery object however since call is still BWC module I can't do this.

 

I'm stuck! any pointer?

Outcomes