GetVendorManufacturingOrderList


Description

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

Parameters

Parameter

Type

Description

criteria

VendorManufacturingOrderCriteria

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

context

Context

Specifies information about how the method will be called.


Return Value:

Value

Type

Description

GetVendorManufacturingOrderListResult

ArrayOfVendorManufacturingOrderSummary

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


Interfaces

 

Examples

The following C# example retrieves the list of vendor manufacturing order summary objects with a status of open. A message box displays the order Id and the description for each vendor manufacturing order 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;
			VendorManufacturingOrderSummary[] vendorManufacturingOrderList;
			VendorManufacturingOrderCriteria vendorManufacturingOrderCriteria;
			ListRestrictionOfNullableOfManufacturingOrderStatus statusRestriction;

			// 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 manufacturing order criteria object
			// Use the restriction object to return all open vendor manufacturing orders
			statusRestriction = new ListRestrictionOfNullableOfManufacturingOrderStatus();
			statusRestriction.EqualValue = ManufacturingOrderStatus.Open;
			vendorManufacturingOrderCriteria = new VendorManufacturingOrderCriteria();
			vendorManufacturingOrderCriteria.OrderStatus = statusRestriction;

			// Get the list of vendor manufacturing order objects
			vendorManufacturingOrderList = wsDynamicsGP.GetVendorManufacturingOrderList(
				vendorManufacturingOrderCriteria, context);

			// Display the list of vendor manufacturing orders
			// Display the vendor manufacturing orders with a status of Open
			StringBuilder objectList = new StringBuilder();
			foreach (VendorManufacturingOrderSummary a in vendorManufacturingOrderList)
			{
				// Build the string to display
				objectList.AppendLine(a.ManufacturingOrderDocumentKey.Id + "  " + a.Description);
		}

			MessageBox.Show(objectList.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;
			VendorManufacturingOrderSummary[] vendorManufacturingOrderList;
			VendorManufacturingOrderCriteria vendorManufacturingOrderCriteria;
			ListRestrictionOfNullableOfManufacturingOrderStatus statusRestriction;

			// 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 manufacturing order criteria object
			// Use the restriction object to return all open vendor manufacturing orders
			statusRestriction = new ListRestrictionOfNullableOfManufacturingOrderStatus();
			statusRestriction.EqualValue = ManufacturingOrderStatus.Open;
			vendorManufacturingOrderCriteria = new VendorManufacturingOrderCriteria();
			vendorManufacturingOrderCriteria.OrderStatus = statusRestriction;

			// Get the list of vendor manufacturing order objects
			vendorManufacturingOrderList = wsDynamicsGP.GetVendorManufacturingOrderList(
				vendorManufacturingOrderCriteria, context);

			// Display the list of vendor manufacturing orders
			// Display the vendor manufacturing orders with a status of Open
			StringBuilder objectList = new StringBuilder();
			foreach (VendorManufacturingOrderSummary a in vendorManufacturingOrderList)
			{
				// Build the string to display
				objectList.AppendLine(a.ManufacturingOrderDocumentKey.Id + "  " + a.Description);
		}

			MessageBox.Show(objectList.ToString());

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


Documentation Feedback