Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Description
Retrieves a list of customer receivables summary objects that match the specified criteria.
Parameters
Parameter |
Type |
Description |
|---|---|---|
criteria |
The customer receivables summary criteria object that specifies which customer receivables summary objects are returned. |
|
context |
Specifies information about how the method will be called. |
Return Value:
Value |
Type |
Description |
|---|---|---|
GetCustomerReceivablesSummaryList |
The list of customer receivables summary objects that match the specified criteria. |
Interfaces
- Dynamics GP
- Sales
Examples
The following C# example retrieves the list of customer receivables summary objects where the salesperson ID is equal to "Paul W.". A message box displays the customer number and on order amount of each customer that has an on order balance.
** 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 salespersonIdRestriction;
CustomerReceivablesSummaryCriteria customerReceivablesSummaryCriteria;
CustomerReceivablesSummary[] customerReceivablesSummaryList;
// 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 customer receivables summary objects where 'Paul W.' is the specified salesperson
salespersonIdRestriction = new LikeRestrictionOfString();
salespersonIdRestriction.EqualValue = "PAUL W.";
// Create the criteria object and specify the criteria restriction
customerReceivablesSummaryCriteria = new CustomerReceivablesSummaryCriteria();
customerReceivablesSummaryCriteria.SalespersonId = salespersonIdRestriction;
// Retrieve the list of customer receivables summary objects
customerReceivablesSummaryList = wsDynamicsGP.GetCustomerReceivablesSummaryList
(customerReceivablesSummaryCriteria, context);
// Display the customer number and on order amount for members of the
// customer receivables summary list that have an on order balance
StringBuilder summaryList = new StringBuilder();
foreach (CustomerReceivablesSummary a in customerReceivablesSummaryList)
{
if (a.OnOrderAmount.Value > 0)
{
summaryList.AppendLine("Customer: " + a.Key.Id
+ " On order amount: " + a.OnOrderAmount.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;
LikeRestrictionOfstring salespersonIdRestriction;
CustomerReceivablesSummaryCriteria customerReceivablesSummaryCriteria;
CustomerReceivablesSummary[] customerReceivablesSummaryList;
// 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 customer receivables summary objects where 'Paul W.' is the specified salesperson
salespersonIdRestriction = new LikeRestrictionOfstring();
salespersonIdRestriction.EqualValue = "PAUL W.";
// Create the criteria object and specify the criteria restriction
customerReceivablesSummaryCriteria = new CustomerReceivablesSummaryCriteria();
customerReceivablesSummaryCriteria.SalespersonId = salespersonIdRestriction;
// Retrieve the list of customer receivables summary objects
customerReceivablesSummaryList = wsDynamicsGP.GetCustomerReceivablesSummaryList
(customerReceivablesSummaryCriteria, context);
// Display the customer number and on order amount for members of the
// customer receivables summary list that have an on order balance
StringBuilder summaryList = new StringBuilder();
foreach (CustomerReceivablesSummary a in customerReceivablesSummaryList)
{
if (a.OnOrderAmount.Value > 0)
{
summaryList.AppendLine("Customer: " + a.Key.Id
+ " On order amount: " + a.OnOrderAmount.Value.ToString("C"));
}
}
MessageBox.Show(summaryList.ToString());
// Close the service
if(wsDynamicsGP.State != CommunicationState.Faulted)
{
wsDynamicsGP.Close();
}
}
}