Quantcast
Viewing latest article 6
Browse Latest Browse All 24

Plugins: Error when taking email from the owner.

Hello,

I was trying to get the email from the owner entity from my plugin. But it didn't allow me.

I was trying to check it, but looks like Owner is referencing the entity User.

How can I take this email from a plugin? below some of my code.

try
{
   entRefOwnerUser = entPartner.GetAttributeValue<EntityReference>("ownerid");
   Entity entOwnerUser = PluginHelper.GetContact(service, entRefOwnerUser);

   if (entOwnerUser.Contains("internalemailaddress"))
    {
     ONBOARDINGEMAIL = entOwnerUser.GetAttributeValue<string>("internalemailaddress");
    }
}
catch (Exception ex)
{
    myTrace.WriteLine("Error: " + ex.Message);
}


Thank you very much,

Regards & Blessings.


Viewing latest article 6
Browse Latest Browse All 24

Trending Articles