{
try
{
QueryExpression sorgu = new QueryExpression()
{
EntityName = "opportunityproduct",
ColumnSet = new ColumnSet("opportunityproductid", "opportunityid"),
LinkEntities =
{
new LinkEntity
{
LinkFromEntityName="opportunityproduct",
LinkFromAttributeName="opportunityid",
LinkToEntityName = "opportunity",
LinkToAttributeName = "opportunityid",
LinkCriteria = new FilterExpression
{
FilterOperator = LogicalOperator.And,
Conditions =
{
new ConditionExpression
{
AttributeName = "opportunityid",
Operator = ConditionOperator.Equal,
Values = { opportunityid }
}
}
}
}
}
};
EntityCollection ec = null;
ec = ser.RetrieveMultiple(sorgu);
if (ec != null && ec.Entities.Count > 0)
return ec;
else
return new EntityCollection();
}
catch (Exception ex)
{
throw ex;
}
}
Metot Kullanımı
EntityCollection ec_FirsatUrunleri = Core.GetOpportunityDetails(opportunityId, crmService);
if (ec_FirsatUrunleri != null && ec_FirsatUrunleri.Entities.Count != 0)
{
foreach (var item in ec_FirsatUrunleri.Entities)
{
OpportunityProduct firsaturunu = (OpportunityProduct)item;
if (firsaturunu != null && firsaturunu.Id != Guid.Empty)
{
}
}
}
Hiç yorum yok:
Yorum Gönder