---
schema_version: "1"
id: ca99122363d512d78dac7542f5df24df68f2a93c0b1b9857a2895e25b34e611d
title: CreateMscrmRecord()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/microsoft-dynamics-crm/mc-ampscript-reference-microsoft-dynamics-crm-create-record.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-mscrm/mc-ampscript-reference-microsoft-dynamics-crm-create-record.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 16239df8bccb9747485b833b35ebba6541ff1cfefaf483ac520db12823aadfc9
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# 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.
