Answers for "dump custom entity to tracelog dynamics crm 365 ce online c# extension"

C#
0

dump custom entity to tracelog dynamics crm 365 ce online c# extension

// Global Values
EntityReference entityReference = new EntityReference("account", Guid.Parse("608DA112-2681-4967-B30E-A4132321010A")); // Normally will be retrieved from an entity.
string[] columnNames= new string[] { ..list of fields.. };
 
// Default SDK Retrieve call.
service.Retrieve(entityReference.LogicalName, entityReference.Id, new ColumnSet(columnNames));
 
// Overloaded extension Retrieve call.
service.Retrieve(entityReference, columnNames);
 
// The overload in from the extension static class
public static Entity Retrieve(this IOrganizationService service, EntityReference entityReference, string[] columnNames)
    => service.Retrieve(entityReference.LogicalName, entityReference.Id, new ColumnSet(columnNames));
Posted by: Guest on April-14-2021
0

dump custom entity to tracelog dynamics crm 365 ce online c# extension

Guid entityReferenceId = account1.Contains("primarycontact")
    ? ((EntityReference)account1["primarycontact"]).Id
    : Guid.Empty;
 
if (entityReferenceId == Guid.Empty)
{
    if (account2.Contains("primarycontact"))
    {
        account2["primarycontact"] = null;
    }
}
else
{
    if (account2.Contains("primarycontact"))
    {
        account2["primarycontact"] = new EntityReference("contact", entityReferenceId);
    }
    else
    {
        account2.Attributes.Add("primarycontact") = new EntityReference("contact", entityReferenceId);
    }
}
Posted by: Guest on April-14-2021

Code answers related to "dump custom entity to tracelog dynamics crm 365 ce online c# extension"

C# Answers by Framework

Browse Popular Code Answers by Language