Documentation

Identifiers

Each entity type has its identifiers. Such IDs have numerous variety. Below are the main types listed

  • entityTypeId - entity type ID, int
  • entityName - entity type string ID, string
  • entityTypeAbbr - abbreviated string ID with type, string not more than 3 characters
  • userFieldEntityId - entity ID for custom field settings, string
  • statusEntityId - value for column ENTITY_ID for table b_crm_status, and for stage and statuses string
  • permissionEntity - element type ID, used when checking permissions, string
  • suspendedEntityTypeId - entity type ID for recycle bin entity, int
  • suspendedEntityTypeName - string entity type ID for recycle bin, string
  • suspendedUserFieldEntityId - entity ID for custom field settings in recycle bin, string

The entities with pipelines (deals, SPAs), some IDs will be unique within pipeline

When an element of specific entity type is placed into recycle bin, portion of its IDs change and displayed in the general list.

Main ID is entityTypeId. Knowing this type's ID, you can (not always easily) retrieve the rest of information

Frontend has a similar helper, BX.CrmEntityType in the file crm/install/js/crm/common.js

Numeric and string IDs can be retrieved via the constants/class methods \CCrmOwnerType.


List of main IDs:

  • Leads
    • entityTypeId = \CCrmOwnerType::Lead = 1
    • entityTypeName = \CCrmOwnerType::LeadName = 'LEAD'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Lead = 'L'
    • userFieldEntityId = \CAllCrmLead::USER_FIELD_ENTITY_ID = 'CRM_LEAD'
    • statusEntityId = 'STATUS'
    • permissionEntity = 'LEAD'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedLead = 18
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedLeadName = 'SUS_LEAD
    • suspendedUserFieldEntityId = \CAllCrmLead::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_LEAD_SPD'

  • Deal in a default pipeline.
    • entityTypeId = \CCrmOwnerType::Deal = 2
    • entityTypeName = \CCrmOwnerType::DealName = 'DEAL'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Deal = 'D'
    • userFieldEntityId = \CAllCrmDeal::USER_FIELD_ENTITY_ID = 'CRM_DEAL'
    • statusEntityId = 'DEAL_STAGE'
    • permissionEntity = 'DEAL'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedDeal = 19
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedDealName = 'SUS_DEAL
    • suspendedUserFieldEntityId = \CAllCrmDeal::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_DEAL_SPD'

  • Deal in pipeline with identifier 3
    • entityTypeId = \CCrmOwnerType::Deal = 2
    • entityTypeName = \CCrmOwnerType::DealName = 'DEAL'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Deal = 'D'
    • userFieldEntityId = \CAllCrmDeal::USER_FIELD_ENTITY_ID = 'CRM_DEAL'
    • statusEntityId = 'DEAL_STAGE_3'
    • permissionEntity = 'DEAL_C3'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedDeal = 19
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedDealName = 'SUS_DEAL
    • suspendedUserFieldEntityId = \CAllCrmDeal::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_DEAL_SPD'

  • Contact
    • entityTypeId = \CCrmOwnerType::Contact = 3
    • entityTypeName = \CCrmOwnerType::ContactName = 'CONTACT'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Contact = 'C'
    • userFieldEntityId = \CAllCrmContact::USER_FIELD_ENTITY_ID = 'CRM_CONTACT'
    • statusEntityId - unavailable
    • permissionEntity = 'CONTACT'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedContact = 20
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedContactName = 'SUS_CONTACT
    • suspendedUserFieldEntityId = \CAllCrmContact::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_CONTACT_SPD'

  • Company
    • entityTypeId = \CCrmOwnerType::Company = 4
    • entityTypeName = \CCrmOwnerType::CompanyName = 'COMPANY'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Company = 'CO'
    • userFieldEntityId = \CAllCrmCompany::USER_FIELD_ENTITY_ID = 'CRM_COMPANY'
    • statusEntityId - unavailable
    • permissionEntity = 'COMPANY'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedCompany = 21
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedCompanyName = 'SUS_COMPANY
    • suspendedUserFieldEntityId = \CAllCrmCompany::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_COMPANY_SPD'

  • Invoices (legacy version)
    • entityTypeId = \CCrmOwnerType::Invoice = 5
    • entityTypeName = \CCrmOwnerType::InvoiceName = 'INVOICE'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Invoice = 'I'
    • userFieldEntityId = \CAllCrmInvoice::USER_FIELD_ENTITY_ID = 'CRM_INVOICE'
    • statusEntityId = 'INVOICE_STATUS'
    • permissionEntity = 'INVOICE'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedInvoice = 23
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedInvoiceName = 'SUS_INVOICE
    • suspendedUserFieldEntityId = \CAllCrmInvoice::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_INVOICE_SPD'

  • Quotes
    • entityTypeId = \CCrmOwnerType::Quote = 7
    • entityTypeName = \CCrmOwnerType::QuoteName = 'QUOTE'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Quote = 'Q'
    • userFieldEntityId = \CAllCrmQuote::USER_FIELD_ENTITY_ID = 'CRM_QUOTE'
    • statusEntityId = 'QUOTE_STATUS'
    • permissionEntity = 'QUOTE'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedQuote = 22
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedQuoteName = 'SUS_QUOTE
    • suspendedUserFieldEntityId = \CAllCrmQuote::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_QUOTE_SPD'

  • Orders
    • entityTypeId = \CCrmOwnerType::Quote = 14
    • entityTypeName = \CCrmOwnerType::OrderName = 'ORDER'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::Order = 'O'
    • userFieldEntityId = \Bitrix\Crm\Order\Manager::getUfId() = 'ORDER'
    • statusEntityId - unavailable, due to order statuses being stored in b_sale_status
    • permissionEntity = 'ORDER'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedOrder = 24 - not used, orders do not support recycle bin
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedOrderName = 'SUS_ORDER - not used, orders do not support recycle bin
    • suspendedUserFieldEntityId - unavailable, orders do not support recycle bin

  • Invoices with default pipeline having ID = 10
    • entityTypeId = \CCrmOwnerType::SmartInvoice = 31
    • entityTypeName = \CCrmOwnerType::SmartInvoiceName = 'SMART_INVOICE'
    • entityTypeAbbr = \CCrmOwnerTypeAbbr::SmartInvoice = 'SI'
    • userFieldEntityId = \Bitrix\Crm\Service\Factory\SmartInvoice::USER_FIELD_ENTITY_ID = 'CRM_SMART_INVOICE'
    • statusEntityId = 'SMART_INVOICE_STAGE_10'
    • permissionEntity = 'SMART_INVOICE_C10'
    • suspendedEntityTypeId = \CCrmOwnerType::SuspendedSmartInvoice = 32
    • suspendedEntityTypeName = \CCrmOwnerType::SuspendedSmartInvoiceName = 'SUS_SMART_INVOICE
    • suspendedUserFieldEntityId = \Bitrix\Crm\Service\Factory\SmartInvoice::SUSPENDED_USER_FIELD_ENTITY_ID = 'CRM_SMART_INVOICE_SPD'

  • SPA with ID type 128 and ID 1 (ID column in b_crm_dynamic_type), default pipeline has id = 20
    • entityTypeId = 128
    • entityTypeName = 'DYNAMIC_128'
    • entityTypeAbbr = 'T80'
    • userFieldEntityId = 'CRM_1'
    • statusEntityId = 'DYNAMIC_128_STAGE_20'
    • permissionEntity = 'DYNAMIC_128_C20'
    • suspendedEntityTypeId = 192
    • suspendedEntityTypeName = 'SUS_DYNAMIC_128
    • suspendedUserFieldEntityId = 'CRM_1_SPD'

SPA type IDs are between 128 and 191 (inclusively).

SAP type IDs, deleted to recycle bin are between 192 and 255 (inclusively).

© «Bitrix24», 2001-2024
Up