CRM 2011 - Equipment Oluşturma (Create Equipment)
C# Code
#region Create TesisEkipman
Equipment equipment = new Equipment();
equipment.Name ="New Created Equipment";
equipment.Description ="Item description";
equipment.CalendarId = new EntityReference("calendar", "guidvalue") ;
equipment.DisplayInServiceViews =true;
equipment.EMailAddress = "gkhnmnts@hotmail.com";
equipment.IsDisabled = false;
equipment.SiteId =new EntityReference("site", "guidvalue") ;
equipment.Skills =" item.Skills";
equipment.TimeZoneCode = 1;
equipment.BusinessUnitId = new EntityReference("businessunit", "guidvalue") ;
crmService.Create(equipment);
#endregion
Örnek :
string fetchBU = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='businessunit'>
<attribute name='name' />
<attribute name='address1_telephone1' />
<attribute name='websiteurl' />
<attribute name='parentbusinessunitid' />
<attribute name='businessunitid' />
<order attribute='name' descending='false' />
</entity>
</fetch>";
EntityCollection resultequipments = crmServiceDev.RetrieveMultiple(new FetchExpression(fetchBU));
if (resultequipments.Entities.Count > 0)
{
Guid BuId;
BuId = (Guid)resultequipments.Entities[0]["businessunitid"];
Entity equipment = new Entity("equipment");
equipment["name"] = "test";
equipment["businessunitid"] = new EntityReference("businessunit",BuId);
equipment["timezonecode"] = 1;
crmServiceDev.Create(equipment);
Console.WriteLine("Facility successfully created");
}
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder