Im trying to create a new activity from each individual value. What I have done so far is shown below in snippets to get each value.
var Names = recordRow.Cells[0].Value.ToString().Split(",".ToArray(),StringSplitOptions.RemoveEmptyEntries);'
For each value in in the cell, populate a field in the activity form
foreach (var Name in Names)
{
newAct.RegardingObjectId = new EntityReference(Lead.EntityLogicalName, actualCRMLead.Id);
_xrm.Create(newAct);
}
How do it create a new activity once the RegardObjectId field in populated?
Thanks,
EDIT 1; If there are 3 names in the one cell it will create 9 activities, how can I stop it from creating duplicates?