Satish Vavni

Populate one to one relationship's custom field in SugarCRM 6.5

Discussion created by Satish Vavni on Feb 2, 2017

I am using SugarCRM 6.5 community version and I need to create one edit view with merge related module. See here is scenario:

 

1. First parent module "Meetings"
2. I have create second module and it's name is "Driver Guide Service"

 

So the two modules have one-to-one relationship.

 

I want to render Driver Guide Service's custom field in Meetings's Edit view.

 

Here is existing relationship. and now I want to create driver_guide_service_cstm'field's  dictionary in Meeting's module that's not working.

 

    $dictionary["Meeting"]["fields"]["meetings_dri_driver_guide_service_1"] = array (
      'name' => 'meetings_dri_driver_guide_service_1',
      'type' => 'link',
      'relationship' => 'meetings_dri_driver_guide_service_1',
      'source' => 'non-db',
      'module' => 'dri_driver_guide_service',
      'bean_name' => 'dri_driver_guide_service',
      'vname' => 'LBL_MEETINGS_DRI_DRIVER_GUIDE_SERVICE_1_FROM_DRI_DRIVER_GUIDE_SERVICE_TITLE',
      'id_name' => 'meetings_dri_driver_guide_service_1dri_driver_guide_service_idb',
    );
    $dictionary["Meeting"]["fields"]["meetings_dri_driver_guide_service_1_name"] = array (
      'name' => 'meetings_dri_driver_guide_service_1_name',
      'type' => 'relate',
      'source' => 'non-db',
      'vname' => 'LBL_MEETINGS_DRI_DRIVER_GUIDE_SERVICE_1_FROM_DRI_DRIVER_GUIDE_SERVICE_TITLE',
      'save' => true,
      'id_name' => 'meetings_dri_driver_guide_service_1dri_driver_guide_service_idb',
      'link' => 'meetings_dri_driver_guide_service_1',
      'table' => 'dri_driver_guide_service',
      'module' => 'dri_driver_guide_service',
      'rname' => 'name',
    );
    $dictionary["Meeting"]["fields"]["meetings_dri_driver_guide_service_1dri_driver_guide_service_idb"] = array (
      'name' => 'meetings_dri_driver_guide_service_1dri_driver_guide_service_idb',
      'type' => 'link',
      'relationship' => 'meetings_dri_driver_guide_service_1',
      'source' => 'non-db',
      'reportable' => false,
      'side' => 'left',
      'vname' => 'LBL_MEETINGS_DRI_DRIVER_GUIDE_SERVICE_1_FROM_DRI_DRIVER_GUIDE_SERVICE_TITLE',
    );

 

This below code are not working for custom column.

 

    $dictionary["Meeting"]["fields"]["meetings_dri_driver_guide_service_1_dri_start_city_c"] = array (
      'name' => 'meetings_dri_driver_guide_service_1_dri_start_city_c',
      'type' => 'relate',
      'source' => 'non-db',
      'vname' => 'LBL_MEETINGS_DRI_DRIVER_GUIDE_SERVICE_1_FROM_DRI_DRIVER_GUIDE_SERVICE_TITLE',
      'save' => true,
      'id_name' => 'meetings_dri_driver_guide_service_1dri_driver_guide_service_idb',
      'link' => 'meetings_dri_driver_guide_service_1',
      'table' => 'dri_driver_guide_service',
      'module' => 'dri_driver_guide_service',
      'rname' => 'dri_start_city_c',
    );

 

this "dri_start_city_c" is custom column for "dri_driver_guide_service"'s module. and this I want to render in meeting module's edit view. all other column are working fine except custom column so anyone can help me to figure out this issue.

Outcomes