rname metadata not respected in search?

I have two custom modules with a 1-M relationship: Contract - ContractDetails

1 Contract has multiple Contract Details.

In Contract Details the Contract appears as a relate field but I want the contract_number not the contract_name to be displayed.

This works fine in the record view of contract details, and the list view but when I need to search by contract number in the Contract Details module the search field expects a name, not a number. But when I start to type the name the SQS starts listing numbers that match that name...

Any thoughts on how to fix that?

From Contract Details Vadefs:

$dictionary["wcont_ContractPDetails"]["fields"]["wcont_contractpdetails_wcont_contracts_name"] = array (

  'name' => 'wcont_contractpdetails_wcont_contracts_name',

  'type' => 'relate',

  'source' => 'non-db',

  'vname' => 'LBL_WCONT_CONTRACTPDETAILS_WCONT_CONTRACTS_FROM_WCONT_CONTRACTS_TITLE',

  'save' => true,

  'id_name' => 'wcont_wolfb293ntracts_ida',

  'link' => 'wcont_contractpdetails_wcont_contracts',

  'table' => 'wcont_contracts',

  'module' => 'wcont_Contracts',

  'rname' => 'contract_number',

);

Thanks,

FrancescaS

Parents Reply
  • Hi Francesca, 

    I have figured out a way for that, but its Applicable to Complete Module

    Suppose, we want to shift Account Module Search/Relate fields search from 'name' to 'custom_fields_c'

    Then we can achieve it by using below 2 steps

    1) In Defination of Related fields 

    add 'rname' => 'custom_fields_c'

    2) Check below file 

    custom/modules/Accounts/client/base/filter/default/default.php

    if not present copy it from module directory ie modules/Accounts/client/base/filter/basic/basic.php

    In this file, 

    please check 'quicksearch_field' array 

    Please replace 'name' with your custom field name 

    e.g 

    'quicksearch_field' => 

    array (
    0 => 'name',
    ),

    3) Do Repair and Rebuild and you are done 

Children