How Do I Create a PhoneCall (Activity) with the Dynamics CRM Connector? (Magic xpi 4.9)
A PhoneCall object is a type of Activity that is related to Case objects. A Case object can be related to a Contact object or an Account object. So, to create a PhoneCall, you first need to determine the parent Contact/Account, and then drill down to the Activity.
This example explains how to create a PhoneCall for a Contact’s Case.

-
Get a Contact’s ID.
-
In this example, get the ID of a Contact whose first name is 'Marco'.

-
Next, use the Data Mapper to save the Contact’s ID into the F.ContactId Alpha variable.

-
Create an Incident object for that Contact. In Dynamics CRM, an Incident can also be called a Case.
-
Save the newly created Incident’s ID into the F.IncidentId Alpha variable.

-
When you create an Incident, you must refer it to a Customer.
In the Web-based UI (below), note the mandatory asterisk for the Customer field:

In Magic xpi, you need to provide the CustomerId and define the Customer’s type, which in this case is 'contact'.

In addition, you need to provide a name for the newly created Incident. In this example, call it 'Incident 1'.

-
Create a PhoneCall object for the Incident that you created, as shown in the following image.

Note that there is a field named Regarding in the Web-based UI. Later on, this topic will explain how to set a value to that attribute via Magic xpi.

In Magic xpi, you should save the newly created PhoneCall’s ID into the F.PhoneCallId Alpha variable.

Next, you need to provide the RegardingObjectId and its type, which is 'Incident' in this example. In addition, you need to provide a name to the newly created PhoneCall. Here, call it 'PhoneCall 1'.
