Retrieves a list of inventory transfer summary objects that meet the specified criteria.
Parameter |
Type |
Description |
---|---|---|
criteria |
The inventory transfer criteria object that specifies which inventory transfer summary objects to retrieve. |
|
context |
Specifies information about how the method will be called. |
Value |
Type |
Description |
---|---|---|
GetInventoryTransferListResult |
A list of the inventory transfer summary objects that match the specified criteria. |
The following C# example retrieves the list of inventory transfer summary objects where the batch assigned to the inventory transfer begins with “TRANSFER”. A message box displays the document number for each inventory transfer 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; LikeRestrictionOfString batchIdRestriction; InventoryTransferCriteria inventoryTransferCriteria; InventoryTransferSummary[] inventoryTransferSummaries; // 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 the restriction object // Retrieve all inventory transfers with a batch key that begins with 'TRANSFER' batchIdRestriction = new LikeRestrictionOfString(); batchIdRestriction.Like = "TRANSFER%"; // Create the inventory transfer criteria object inventoryTransferCriteria = new InventoryTransferCriteria(); inventoryTransferCriteria.BatchId = batchIdRestriction; // Retrieve the list of inventory transfer summary objects inventoryTransferSummaries = wsDynamicsGP.GetInventoryTransferList( inventoryTransferCriteria, context); // Display the key Id property for each member of the summary object list StringBuilder summaryList = new StringBuilder(); foreach (InventoryTransferSummary a in inventoryTransferSummaries) { summaryList.AppendLine("Inventory transfer document number: " + a.Key.Id); } MessageBox.Show(summaryList.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; LikeRestrictionOfstring batchIdRestriction; InventoryTransferCriteria inventoryTransferCriteria; InventoryTransferSummary[] inventoryTransferSummaries; // 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 the restriction object // Retrieve all inventory transfers with a batch key that begins with 'TRANSFER' batchIdRestriction = new LikeRestrictionOfstring(); batchIdRestriction.Like = "TRANSFER%"; // Create the inventory transfer criteria object inventoryTransferCriteria = new InventoryTransferCriteria(); inventoryTransferCriteria.BatchId = batchIdRestriction; // Retrieve the list of inventory transfer summary objects inventoryTransferSummaries = wsDynamicsGP.GetInventoryTransferList( inventoryTransferCriteria, context); // Display the key Id property for each member of the summary object list StringBuilder summaryList = new StringBuilder(); foreach (InventoryTransferSummary a in inventoryTransferSummaries) { summaryList.AppendLine("Inventory transfer document number: " + a.Key.Id); } MessageBox.Show(summaryList.ToString()); // Close the service if(wsDynamicsGP.State != CommunicationState.Faulted) { wsDynamicsGP.Close(); } } } }