Retrieves a list of planned order summary objects that match the specified criteria.
Parameter |
Type |
Description |
---|---|---|
criteria |
A planned order criteria object that specifies which planned order summary objects are returned. |
|
context |
Specifies information about how the method will be called. |
Value |
Type |
Description |
---|---|---|
GetPlannedOrderListResult |
The list of planned order summary objects that match the specified criteria. |
The following C# example retrieves the list of all planned order summary objects. The total number of planned order summary objects is displayed in a message box.
Legacy endpoint
using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using DynamicsGPWebServiceSample.DynamicsGPWebService; namespace DynamicsGPWebServiceSample { class Program { static void Main(string[] args) { CompanyKey companyKey; Context context; LikeRestrictionOfString idRestriction; PlannedOrderSummary[] plannedOrderList; PlannedOrderCriteria plannedOrderCriteria; // Create an instance of the service DynamicsGP wsDynamicsGP = new DynamicsGP(); // Be sure the default credentials are used wsDynamicsGP.UseDefaultCredentials = true; // Create a context with which to call the service context = new Context(); // Specify which company to use (sample company) companyKey = new CompanyKey(); companyKey.Id = (-1); // Set up the context object context.OrganizationKey = (OrganizationKey)companyKey; // Create a planned order criteria object idRestriction = new LikeRestrictionOfString(); idRestriction.Like = "%"; plannedOrderCriteria = new PlannedOrderCriteria(); plannedOrderCriteria.PlannedOrderKey = idRestriction; // Get the list of planned order summary objects plannedOrderList = wsDynamicsGP.GetPlannedOrderList(plannedOrderCriteria, context); // Display the list of planned orders MessageBox.Show("Total planned orders: " + plannedOrderList.Length.ToString()); } } }
Native endpoint
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using DynamicsGPWebServiceSample.DynamicsGPWebService; namespace DynamicsGPWebServiceSample { class Program { static void Main(string[] args) { CompanyKey companyKey; Context context; LikeRestrictionOfstring idRestriction; PlannedOrderSummary[] plannedOrderList; PlannedOrderCriteria plannedOrderCriteria; // Create an instance of the service DynamicsGPClient wsDynamicsGP = new DynamicsGPClient(); // Create a context with which to call the service context = new Context(); // Specify which company to use (sample company) companyKey = new CompanyKey(); companyKey.Id = (-1); // Set up the context object context.OrganizationKey = (OrganizationKey)companyKey; // Create a planned order criteria object idRestriction = new LikeRestrictionOfstring(); idRestriction.Like = "%"; plannedOrderCriteria = new PlannedOrderCriteria(); plannedOrderCriteria.PlannedOrderKey = idRestriction; // Get the list of planned order summary objects plannedOrderList = wsDynamicsGP.GetPlannedOrderList(plannedOrderCriteria, context); // Display the list of planned orders MessageBox.Show("Total planned orders: " + plannedOrderList.Length.ToString()); // Close the service if(wsDynamicsGP.State != CommunicationState.Faulted) { wsDynamicsGP.Close(); } } } }