public static EntityCollection OrderDetailInOrder(IOrganizationService ser, Guid orderid, ColumnSet columnset)
{
try
{
QueryExpression sorgu = new QueryExpression()
{
EntityName = "salesorderdetail",
ColumnSet = columnset,
LinkEntities =
{
new LinkEntity
{
LinkFromEntityName="salesorderdetail",
LinkFromAttributeName="salesorderid",
LinkToEntityName = "salesorder",
LinkToAttributeName = "salesorderid",
LinkCriteria = new FilterExpression
{
FilterOperator = LogicalOperator.And,
Conditions =
{
new ConditionExpression("salesorderid",ConditionOperator.Equal,orderid)
}
}
}
}
};
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;
}
}
Hiç yorum yok:
Yorum Gönder