Show only records related to another module

Hello,

First of all, I'm using SugarCRM CE 6.5.24

I've created a custom module, called "Time Sheet", it has the following fields:

Accounts and Project are "relate" fields. My question is, how to show projects that are related to the selected account (I added a One-to-Many relationship between [Account] and [Project].

Is it required to also make the Account and Project field not only "relate" type, but to add a relationship between respective modules?

Thank you!

Parents
  • Hi Rron,

    You can do this custom in editviewdefs.php

    This is example in Tasks module.

    custom/modules/Tasks/metadata/editviewdefs.php

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

    If you select Account then select Contact, it will filter contact by Account selected.

    If you want i can help to fix your issues, please send ftp detail to my email: support@youaddon.com

    Regards,

    Bill

    YouAddOn Team

Reply
  • Hi Rron,

    You can do this custom in editviewdefs.php

    This is example in Tasks module.

    custom/modules/Tasks/metadata/editviewdefs.php

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

    If you select Account then select Contact, it will filter contact by Account selected.

    If you want i can help to fix your issues, please send ftp detail to my email: support@youaddon.com

    Regards,

    Bill

    YouAddOn Team

Children