GetVendorPlannedOrderList


Description

Retrieves a list of vendor planned order summary objects that match the specified criteria.

Parameters

Parameter

Type

Description

criteria

VendorPlannedOrderCriteria

The vendor planned order criteria object that specifies which vendor planned order summary objects to return.

context

Context

Specifies information about how the method will be called.


Return Value:

Value

Type

Description

GetVendorPlannedOrderListResult

ArrayOfVendorPlannedOrderSummary

The list of vendor planned order summary objects that match the specified criteria.


Interfaces

 

Examples

The following C# example retrieves the list of all vendor planned order summary objects. A message box displays the number of vendor planned order summary objects in the list.

 Legacy endpoint

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using DynamicsGPWebServiceSample.DynamicsGPService;

namespace DynamicsGPWebServiceSample
{
	class Program
	{
		static void Main(string[] args)
		{
			CompanyKey companyKey;
			Context context;
			VendorPlannedOrderSummary[] vendorPlannedOrderList;
			VendorPlannedOrderCriteria vendorPlannedOrderCriteria;
			LikeRestrictionOfString plannedOrderIdRestriction;

			// Create an instance of the service
			DynamicsGP wsDynamicsGP = new DynamicsGP();

			// Be sure that 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 vendor planned order criteria object
			plannedOrderIdRestriction = new LikeRestrictionOfString();
			plannedOrderIdRestriction.Like = "%";
			vendorPlannedOrderCriteria = new VendorPlannedOrderCriteria();
			vendorPlannedOrderCriteria.PlannedOrderKey = plannedOrderIdRestriction;

			// Get the list of vendor planned order summary objects
			vendorPlannedOrderList = wsDynamicsGP.GetVendorPlannedOrderList(vendorPlannedOrderCriteria, context);

			// Displays the list of vendor planned order summary objects
			MessageBox.Show("Total number of vendor planned orders: " + 
				vendorPlannedOrderList.Length.ToString());
	}
}
}

 Native endpoint

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DynamicsGPWebServiceSample.DynamicsGPService;

namespace DynamicsGPWebServiceSample
{
	class Program
	{
		static void Main(string[] args)
		{
			CompanyKey companyKey;
			Context context;
			VendorPlannedOrderSummary[] vendorPlannedOrderList;
			VendorPlannedOrderCriteria vendorPlannedOrderCriteria;
			LikeRestrictionOfstring plannedOrderIdRestriction;

			// 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 vendor planned order criteria object
			plannedOrderIdRestriction = new LikeRestrictionOfstring();
			plannedOrderIdRestriction.Like = "%";
			vendorPlannedOrderCriteria = new VendorPlannedOrderCriteria();
			vendorPlannedOrderCriteria.PlannedOrderKey = plannedOrderIdRestriction;

			// Get the list of vendor planned order summary objects
			vendorPlannedOrderList = wsDynamicsGP.GetVendorPlannedOrderList(vendorPlannedOrderCriteria, context);

			// Displays the list of vendor planned order summary objects
			MessageBox.Show("Total number of vendor planned orders: " + 
				vendorPlannedOrderList.Length.ToString());

			// Close the service
			if(wsDynamicsGP.State != CommunicationState.Faulted)
			{
				wsDynamicsGP.Close();
		}
	}
}
}


Documentation Feedback