GetReceivablesCreditMemoList
Description
Retrieves a list of receivables credit memo summary objects that match the specified criteria.
Parameters
Parameter |
Type |
Description |
---|---|---|
criteria |
A receivables credit memo criteria object that specifies which receivables credit memo summary objects are returned. |
|
context |
Specifies information about how the method will be called. |
Return Value:
Value |
Type |
Description |
---|---|---|
GetReceivablesCreditMemoListResult |
The list of receivables credit memo summary objects that match the specified criteria. |
Interfaces
- Dynamics GP
- Sales
Examples
The following C# example retrieves the list of receivables credit memo summary objects where the date property is between two specified dates. A message box displays the customer ID and the credit memo amount for the receivables credit memo summary objects that match the date criteria.
** 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; BetweenRestrictionOfNullableOfDateTime dateRestriction; ReceivablesCreditMemoCriteria creditMemoCriteria; ReceivablesCreditMemoSummary[] creditMemoSummaries; // 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 restriction object // Retrieve all the credit memo objects from August 2003 dateRestriction = new BetweenRestrictionOfNullableOfDateTime(); dateRestriction.From = new DateTime(2003, 8, 1); dateRestriction.To = new DateTime(2003, 8, 30); // Create the credit memo criteria object creditMemoCriteria = new ReceivablesCreditMemoCriteria(); creditMemoCriteria.Date = dateRestriction; // Retrieve the list of credit memo summary objects creditMemoSummaries = wsDynamicsGP.GetReceivablesCreditMemoList(creditMemoCriteria, context); // Display the customer ID and the amount of each member of the summary object list StringBuilder summaryList = new StringBuilder(); foreach (ReceivablesCreditMemoSummary a in creditMemoSummaries) { summaryList.AppendLine("Customer ID: " + a.CustomerKey.Id + " Credit memo amount: " + a.DocumentAmount.Value.ToString("C")); } MessageBox.Show(summaryList.ToString()); } } }
** Native endpoint **
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; using System.Windows.Forms; using DynamicsGPWebServiceSample.DynamicsGPService; namespace DynamicsGPWebServiceSample { class Program { static void Main(string[] args) { CompanyKey companyKey; Context context; BetweenRestrictionOfNullableOfdateTime dateRestriction; ReceivablesCreditMemoCriteria creditMemoCriteria; ReceivablesCreditMemoSummary[] creditMemoSummaries; // 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 restriction object // Retrieve all the credit memo objects from August 2003 dateRestriction = new BetweenRestrictionOfNullableOfdateTime(); dateRestriction.From = new DateTime(2003, 8, 1); dateRestriction.To = new DateTime(2003, 8, 30); // Create the credit memo criteria object creditMemoCriteria = new ReceivablesCreditMemoCriteria(); creditMemoCriteria.Date = dateRestriction; // Retrieve the list of credit memo summary objects creditMemoSummaries = wsDynamicsGP.GetReceivablesCreditMemoList(creditMemoCriteria, context); // Display the customer ID and the amount of each member of the summary object list StringBuilder summaryList = new StringBuilder(); foreach (ReceivablesCreditMemoSummary a in creditMemoSummaries) { summaryList.AppendLine("Customer ID: " + a.CustomerKey.Id + " Credit memo amount: " + a.DocumentAmount.Value.ToString("C")); } MessageBox.Show(summaryList.ToString()); // Close the service if(wsDynamicsGP.State != CommunicationState.Faulted) { wsDynamicsGP.Close(); } } } }