CreateMscrmRecord()

Creates a record in a Microsoft Dynamics CRM entity.

Availability 

Marketing Cloud Engagement ✅ Yes
Marketing Cloud Next ❌ No

Syntax 

1CreateMscrmRecord(entityName,
2                  numFields,
3                  attributeName1, attributeValue1,
4                  [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.

1%%[
2  Var @contact_guid
3  Set @contact_guid = createmscrmrecord('contact', 3,
4                                        'firstname', 'Sun-Hi',
5                                        'lastname', 'Kim',
6                                        'emailaddress1', 'kim.sun-hi@example.com')
7]%%
8
9<p>GUID of new Contact: %%=v(@contact_guid)=%%</p>

The function outputs the GUID of the newly created record.