Compartilhar via


GetReceivablesInvoiceList

Description

Retrieves a list of receivables invoice summary objects that match the specified criteria.

Parameters

Parameter

Type

Description

criteria

ReceivablesInvoiceCriteria

A receivables invoice criteria object that specifies which receivables invoice summary objects are returned.

context

Context

Specifies information about how the method will be called.

Return Value:

Value

Type

Description

GetReceivablesInvoiceListResult

ArrayOfReceivablesInvoiceSummary

The list of receivables invoice summary objects that match the specified criteria.

Interfaces

  • Dynamics GP
  • Sales

Examples

The following C# example retrieves the list of receivables invoice summary objects with a SalespersonId of "Nancy B.". A message box displays the number of receivables invoice summary objects that were retrieved.

Cc508518.LegacyEndpoint(en-us,MSDN.10).gif** 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 salespersonRestriction;
            ReceivablesInvoiceCriteria invoiceCriteria;
            ReceivablesInvoiceSummary[] invoiceSummaries;

            // 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 receivables invoice objects for salesperson 'Nancy B.'
            salespersonRestriction = new LikeRestrictionOfString();
            salespersonRestriction.EqualValue = "Nancy B.";

            // Create the receivables invoice criteria object
            invoiceCriteria = new ReceivablesInvoiceCriteria();
            invoiceCriteria.SalespersonId = salespersonRestriction;

            // Retrieve the list of receivables invoice summary objects
            invoiceSummaries = wsDynamicsGP.GetReceivablesInvoiceList(invoiceCriteria, context);

            // Display the number of receivables invoice objects in the list
            MessageBox.Show("Total invoices for Nancy B.:  " + invoiceSummaries.Length.ToString());
        }
    }
}

Cc508518.NativeEndpoint(en-us,MSDN.10).gif** 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 salespersonRestriction;
            ReceivablesInvoiceCriteria invoiceCriteria;
            ReceivablesInvoiceSummary[] invoiceSummaries;

            // 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 receivables invoice objects for salesperson 'Nancy B.'
            salespersonRestriction = new LikeRestrictionOfstring();
            salespersonRestriction.EqualValue = "Nancy B.";

            // Create the receivables invoice criteria object
            invoiceCriteria = new ReceivablesInvoiceCriteria();
            invoiceCriteria.SalespersonId = salespersonRestriction;

            // Retrieve the list of receivables invoice summary objects
            invoiceSummaries = wsDynamicsGP.GetReceivablesInvoiceList(invoiceCriteria, context);

            // Display the number of receivables invoice objects in the list
            MessageBox.Show("Total invoices for Nancy B.:  " + invoiceSummaries.Length.ToString());

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