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 fee summary objects that match the specified criteria.
Parameters
Parameter |
Type |
Description |
|---|---|---|
criteria |
The fee criteria object that specifies which fee summary objects are returned. |
|
context |
Specifies information about how the method will be called. |
Return Value:
Value |
Type |
Description |
|---|---|---|
GetFeeListResult |
The list of fee summary objects that match the specified criteria. |
Interfaces
- Dynamics GP
- Inventory
Examples
The following C# example retrieves the list of fee summary objects where the fee type is equal to "Flat Fee". A message box displays the description and type property of each fee 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;
ListRestrictionOfNullableOfFeeType feeTypeRestriction;
FeeCriteria feeCriteria;
FeeSummary[] feeSummaries;
// 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 fee with a type of 'Flat Fee'
feeTypeRestriction = new ListRestrictionOfNullableOfFeeType();
feeTypeRestriction.EqualValue = FeeType.FlatFee;
// Create the criteria object and specify the criteria restriction
feeCriteria = new FeeCriteria();
feeCriteria.Type = feeTypeRestriction;
// Retrieve the list of fee summary objects
feeSummaries = wsDynamicsGP.GetFeeList(feeCriteria, context);
// Display the description and type of each member of the fee summary list
StringBuilder summaryList = new StringBuilder();
foreach (FeeSummary a in feeSummaries)
{
summaryList.AppendLine("Fee name: " + a.Description + " Fee type: " +
a.Type.ToString());
}
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;
ListRestrictionOfNullableOfFeeType feeTypeRestriction;
FeeCriteria feeCriteria;
FeeSummary[] feeSummaries;
// 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 fee with a type of 'Flat Fee'
feeTypeRestriction = new ListRestrictionOfNullableOfFeeType();
feeTypeRestriction.EqualValue = FeeType.FlatFee;
// Create the criteria object and specify the criteria restriction
feeCriteria = new FeeCriteria();
feeCriteria.Type = feeTypeRestriction;
// Retrieve the list of fee summary objects
feeSummaries = wsDynamicsGP.GetFeeList(feeCriteria, context);
// Display the description and type of each member of the fee summary list
StringBuilder summaryList = new StringBuilder();
foreach (FeeSummary a in feeSummaries)
{
summaryList.AppendLine("Fee name: " + a.Description + " Fee type: " +
a.Type.ToString());
}
MessageBox.Show(summaryList.ToString());
// Close the service
if(wsDynamicsGP.State != CommunicationState.Faulted)
{
wsDynamicsGP.Close();
}
}
}
}