# CreateMscrmRecord()

Creates a record in a Microsoft Dynamics CRM entity.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
CreateMscrmRecord(entityName,
                  numFields,
                  attributeName1, attributeValue1,
                  [attributeName2, attributeValue2] ...)
```

The `CreateMscrmRecord()` function has four parameters:

- `entityName` (string): Required. The name of the Microsoft Dynamics CRM entity.
- `numFields` (number): Required. The number of name and value pairs of fields to create.
- `attributeName1` (string): Required. The name of the first attribute to populate in the record.
- `attributeValue1` (string): Required. The value of the first attribute to populate in the record.

You can pass multiple name-value pairs for attributes by appending them to the end of the function (`attributeName2, attributeValue2 ...`).

## Usage

This example creates a contact record that contains the attributes *firstname*, *lastname*, and *emailaddress1*.

```
%%[
  Var @contact_guid
  Set @contact_guid = createmscrmrecord('contact', 3,
                                        'firstname', 'Sun-Hi',
                                        'lastname', 'Kim',
                                        'emailaddress1', 'kim.sun-hi@example.com')
]%%

<p>GUID of new Contact: %%=v(@contact_guid)=%%</p>
```

The function outputs the GUID of the newly created record.
