Simple default relationship account_leads fails to load

Very strange. Following fails while being executed inside Accounts bean.


I double checked the relationship name in studio and vardefs too. Any idea why this may be happening?


I used the relationship name as just “leads” instead of “account_leads” and it worked. This is super confusing… When should we use the relationship name as opposed to rhs table?

Having a look in database, table fields_meta_data might help you… or it might confuse you further :slight_smile:

But in load_relationship I think we always specify the rhs table, don’t we?

1 Like

You’re right. If I go to vardefs and look under “fields” array this is where I’ll find the right value to use.

For example here:

        'leads' => array(
            'name' => 'leads',
            'type' => 'link',
            'relationship' => 'account_leads',
            'module' => 'Leads',
            'bean_name' => 'Lead',
            'source' => 'non-db',
            'vname' => 'LBL_LEADS',

The correct value would have been the very top KEY name, which is “leads”, my mistake was using the “relationship” key’s value, which is “account_leads”

1 Like