What table can show me a relate field?

Hi people.

I wanna update some registers with a bad id in a relate field, the problem is, where (what table) can I see this relation on BD? for example, I have a relate field between Products and Sellers, in the field Product->Seller, I have the id of the seller. Some register is bad created, I wanna update these registers.

This field isn't a relationship between modules, is just a "relate" field.

Greetings.

  • Good morning Juan,

    A relate field is just a foreign key in the table of the module you defined it in, so if, for example, you have a Seller Relate Field in Products, then there will be something like seller_id_c in your products table.

    Also See:

    http://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Introduction_to_Relationships_and_Relate_Fields/ 

    HTH,
    FrancescaS

  • If the related field is created as a custom field you find it in table products_cstm which is linked to table products with the coulumn id_c.

    You get all out-of-the-box fields and custom fields by the SQL statement

    SELECT p.*, pc.* from products p 
      left join products_cstm pc
      on p.id=pc.id_c
    where p.deleted=0

    The field name is derived from the modulename of the field. So if the Seller is related to modules Accounts the columnname would be account_id_c if there was no other field related to Accounts before.

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

  • Some system table relates (such as Users) show up a little differently. This also works nicely.

    SELECT custom_module AS database_table_of_custom_module, ext3 AS database_field_name, ext2 AS related_which_module
    FROM fields_meta_data
    WHERE NAME LIKE '<your_file_name_in_studio>'