Documentation

crm.duplicate.findbycomm

crm.duplicate.findbycomm()

The method returns the ID's of the leads, contacts or companies that contain the specified phone numbers or e-mails.

Parameters

Parameter Description
type Specifies the type of communication to search. It can be one of the following values:
  • EMAIL - the e-mail addresses;
  • PHONE - the phone numbers.

This parameter is required.

values An array containing up to 20 e-mails or phone numbers. This parameter is required.
entity_type Optional parameter. It can be skipped: all three entity types will be returned in this case. If this parameter is used, you can operate only with one of them. If you specify an array or non-existent parameter, all entity types will be returned. Types of entities:
  • LEAD - search leads;
  • CONTACT - search contacts;
  • COMPANY - search companies.

Return Value

The result is returned as an object containing arrays of ID's of the matching leads, contacts and companies.

Use the type name to access data in the array. For example:

	
 { 'LEAD': [1, 2, 3], 'CONTACT': [4, 5, 6], 'COMPANY': [7, 8, 9] }


Example of searching for a contact by a phone number:

//Contact search by phone 
        BX24.callMethod(
            "crm.duplicate.findbycomm", 
            {
                entity_type: "CONTACT",
                type: "PHONE",
                values: [ "8976543", "11223355" ],
            }, 
            function(result) 
            {
                if(result.error())
                    console.error(result.error());
                else
                {
                    console.dir(result.data());          
                }
            }
        );


User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix Inc.», 2001-2019, «Bitrix Inc.», 2019