CRM 2011 QueryExpression - Servis Aktivitesi Çekme (Get ServiceAppointment)

   public static ServiceAppointment GetServiceAppointment(IOrganizationService ser, Guid serviceappointmentid, ColumnSet columnset)
        {
            try
            {
                QueryExpression query = GetQueryExpressionSingle("serviceappointment", "activityid", serviceappointmentid, columnset);
                EntityCollection ec = ser.RetrieveMultiple(query);
                if (ec != null && ec.Entities.Count == 1)
                    return (ServiceAppointment)ec.Entities[0];
                else
                    return new ServiceAppointment();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

GetQueryExpressionSingle metodu


Metot Kullanımı

 ServiceAppointment serviceAppointment = CrmManagerStatic.GetServiceAppointment(crmService, item, new ColumnSet(new string[] { "activityid", "regardingobjectid", "ownerid", "activitytypecode", "actualdurationminutes", "statecode", "statuscode" }));
                 

Hiç yorum yok:

Yorum Gönder