Dependent Related Field using pop up filter

There are two modules e.g States and City module related to each other by some relation.
These two modules are also related to Accounts module.

In the Accounts Edit View, when I select the State from States pop up list view, and proceed to select City, what I want is : City pop up list view should only list records related to the selected State.

hope you understand my question?

And Thanks in Advance.

Using

         'displayParams' => 
        array (
          'initial_filter' => '&account_name="+this.form.{$fields.account_name.name}.value+"',
        ),

I achieved my goal…

Oh wow!!! I think m gud… :cheer:

Hi,

I am completely unfamiliar with php, but can follow instructions.
Can you help me to achieve similar thing in a custom module where I want the second drop down to be dependent upon the first one.

Thank You

Hi guys,

I need to do exactly the same, but with multiple fields.
I can easily filter the pop up with a single field by following your example, but run into trouble when I try passing multiple fields in an array to initial_filter:


...
           'displayParams' => 
            array (
              'initial_filter' => array (
			  	'&account_management_type_c_advanced[]=3',
		  	        '&status_advanced={"Active"}',
			  ),
            ),
...

Any advice will be greatly appreciated!

I figured it out:


       ...
            'displayParams' => 
            array (
              'initial_filter' => '&account_management_type_c_advanced[]=2&employee_status_advanced={"Active"}',
            ),
     ...

No need for arrays - just add all the required fields and their values to the query string, separated by ‘&’ :smiley:

en que apartado se escribe este pedazo de código antes mencionado?? :unsure: :unsure:

When I add double quote “”, the link is no longer clickable. That is, if I specify a simple one, such as

‘initial_filter’ => ‘&account_name_advanced=testacct’, it works fine. But, if it becomes ‘initial_filter’ => ‘&account_name_advanced="+this.form.{$fields.account_name.name}.value+"’, the popup link is no longer clickable…

Any idea?

thanks