Skip to content

An occures in Microsoft.Crm.CrmException: Invalid property 'Email_activity_parties' was found in entity 'Microsoft.Dynamics.CRM.email'. ---> Microsoft.OData.ODataException: Does not support untyped value in non-open type #184

@mohammadDarAhmad

Description

@mohammadDarAhmad

Hi,
I am trying to create an email, but I can't because this error is shown to me
```
public bool SendEmail(Guid fromQueue, List recipients, string subj, string description)
{
try
{
ActivityParty fromParty = new ActivityParty
{
PartyId = new EntityReference(Queue.EntityLogicalName, fromQueue)
};

            Email email= new Email
            {
                To = recipients.Select(r => new ActivityParty { AddressUsed = r }),
                From = new ActivityParty[] { fromParty },
                Subject = subj,
                Description = description,
                DirectionCode = true
            };

            using (var service = crmConnection.GetService())
            {
                Guid emailId = Guid.Empty;

                try
                {
                    emailId = service.Create(email);
                }
                catch (Exception ex)
                {
                    return false;
                }

                if (emailId != Guid.Empty)
                {
                    var emailRequest = new SendEmailRequest
                    {
                        EmailId = emailId,
                        TrackingToken = "",
                        IssueSend = true
                    };

                    var emailResponse = (SendEmailResponse)service.Execute(emailRequest);

                    if (emailResponse != null && emailResponse.Results != null && emailResponse.Results.Count > 0)
                    {
                        return true;
                    }

                    else
                    {
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }
        }
        catch (Exception ex)
        {
            return false;
        }
    }
}

}

I try to add EntityCollection 

 Create a new EntityCollection to add the party
                 ```
   EntityCollection from = new EntityCollection();
                    // Create activity party linked to account (from)
                    Entity apEntity = new Entity("activityparty");
                    apEntity.Attributes["partyid"] = new EntityReference("systemuser", fromQueue);
                    from.Entities.Add(apEntity);

                    // Create email
                    Entity emailEntity = new Entity("email");
                    emailEntity.Attributes["subject"] = "Mail Subject GUID";
                    emailEntity.Attributes["from"] = from;`

But I still have the same issue
I am using Microsoft.PowerPlatform.Dataverse.Client 0.5.7 version


Edit
once I used the 0.4.19 version, it's working for me

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions