Documentation

crm.contact.list

Scope: catalog Permissions to execute: for all

Returns a list of contacts selected by the filter specified as the parameter. See the example for the filter notation.

During selection, use masks:

  • "*" - for selection of all fields (excluding user and multiple fields)
  • "UF_*"- for selection of all user fields (without multiple fields)

Masks for selection of multiple fields are unavailable. To select multiple files, indicate the ones you need in the selection list ("PHONE", "EMAIL" and etc.).

To get list of companies, associated with a contact, use the following crm.contact.company.items.get method.

Attention! Fields: phone number, mail, site, messengers are multiple value fields. Filter searches only for the precise match.

Parameters

See the list method reference for the parameters.

Example

<script type="text/javascript">
	BX24.callMethod(
			"crm.contact.list", 
			{ 
				order: { "DATE_CREATE": "ASC" },
				filter: { "TYPE_ID": "CLIENT" },
				select: [ "ID", "NAME", "LAST_NAME", "TYPE_ID", "SOURCE_ID" ]
			}, 
			function(result) 
			{
				if(result.error())
					console.error(result.error());
				else
				{
					console.dir(result.data());			
					if(result.more())
						result.next();						
				}
			}
		);	

// Find contact by phone number
		BX24.callMethod(
			"crm.contact.list", 
			{ 
				filter: { "PHONE": "555888" },
				select: [ "ID", "NAME", "LAST_NAME" ]
			}, 
			function(result) 
			{
				if(result.error())
					console.error(result.error());
				else
				{
					console.dir(result.data());			
					if(result.more())
						result.next();						
				}
			}
		);		
</script>


© «Bitrix24», 2001-2024
Up