public static EntityCollection GetInvoiceDetailInInvoice(IOrganizationService ser, Guid invoiceid, ColumnSet columnset)
{
try
{
QueryExpression sorgu = new QueryExpression()
{
EntityName = "invoicedetail",
ColumnSet = columnset,
LinkEntities =
{
new LinkEntity
{
LinkFromEntityName="invoicedetail",
LinkFromAttributeName="invoiceid",
LinkToEntityName = "invoice",
LinkToAttributeName = "invoiceid",
LinkCriteria = new FilterExpression
{
FilterOperator = LogicalOperator.And,
Conditions =
{
new ConditionExpression("invoiceid",ConditionOperator.Equal,invoiceid)
}
}
}
}
};
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