//Setup query to get all sales order details
QueryExpression q = new QueryExpression();
q.EntityName = "salesorderdetail";
ColumnSet cSet = new ColumnSet(new string[] { "salesorderdetailid", "quantity", "productid" });
q.ColumnSet = cSet;
ConditionExpression con1 = new ConditionExpression("salesorderid", ConditionOperator.Equal, SalesOrderID.ToString());
FilterExpression filter = new FilterExpression();
filter.Conditions.Add(con1);
q.Criteria = filter;
RetrieveMultipleRequest retrieve = new RetrieveMultipleRequest();
retrieve.Query = q;
//Get the response
RetrieveMultipleResponse response = (RetrieveMultipleResponse)service.Execute(retrieve);
QueryExpression q = new QueryExpression();
q.EntityName = "salesorderdetail";
ColumnSet cSet = new ColumnSet(new string[] { "salesorderdetailid", "quantity", "productid" });
q.ColumnSet = cSet;
ConditionExpression con1 = new ConditionExpression("salesorderid", ConditionOperator.Equal, SalesOrderID.ToString());
FilterExpression filter = new FilterExpression();
filter.Conditions.Add(con1);
q.Criteria = filter;
RetrieveMultipleRequest retrieve = new RetrieveMultipleRequest();
retrieve.Query = q;
//Get the response
RetrieveMultipleResponse response = (RetrieveMultipleResponse)service.Execute(retrieve);
No comments:
Post a Comment