Flex relate field of suitecrm

How to add entry in flex relate field using API.
Please assist us as soon as possible


I have created custom module in suitecrm and added flex relate field in it

We are using rest api to do entry in any module.

We found somewhere that flex related field need to be set using relationship.

I tried that also but failed.

Please provide proper solution for it?

never try but a flex relate have 2 field : like this (my memory)

  • parent_type
  • parent_id

Maybe in api :

parent_type = ‘Accounts’
parent_id = ‘qwer-qwer-qwer’ …

Maybe so ?

1 Like

Thanks for your quick reply. i tried that and it work.

Thanks again.

Hi everyone,

This is slightly off-topic but related to “flex relate field”
How i can add custom modules in the list of the flex relate in the Notes module?

module /{module_name}/vardefs.php (add parent_id,parent_name,parent_type array then do repair and rebuild and Execute full script)

    'parent_type' =>
          'name' => 'parent_type',
          'vname' => 'LBL_PARENT_TYPE',
          'type' => 'parent_type',
          'dbType' => 'varchar',
          'required' => false,
          'group' => 'parent_name',
          'options' => 'parent_type_display',
          'len' => 255,
          'comment' => 'The Sugar object to which the call is related'

    'parent_name' =>
          'name' => 'parent_name',
          'parent_type' => 'record_type_display',
          'type_name' => 'parent_type',
          'id_name' => 'parent_id',
          'vname' => 'LBL_LIST_RELATED_TO',
          'type' => 'parent',
          'group' => 'parent_name',
          'source' => 'non-db',
          'options' => 'parent_type_display',

    'parent_id' =>
          'name' => 'parent_id',
          'vname' => 'LBL_LIST_RELATED_TO_ID',
          'type' => 'id',
          'group' => 'parent_name',
          'reportable' => false,
          'comment' => 'The ID of the parent Sugar object identified by parent_type'