Share via


GetMulticurrencySetupList

Description

Retrieves a list of multicurrency setup objects for the specified company.

Parameters

Parameter

Type

Description

criteria

MulticurrencySetupCriteria

The multicurrency setup criteria object. This object will be empty.

context

Context

Specifies information about how the method will be called.

Return Value:

Value

Type

Description

GetMulticurrencySetupListResult

ArrayOfMulticurrencySetup

The list of multicurrency setup objects. This will contain one item for the current company.

Interfaces

  • Dynamics GP
  • Common
  • Field Service
  • Financials
  • Human Resources/Payroll
  • Inventory
  • Manufacturing
  • Project Accounting
  • Purchasing
  • Sales

Examples

The following C# example retrieves the multicurrency setup list for the sample company. The functional currency for the sample company is displayed in a message box.

Cc508497.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)
        {
            Context context;
            CompanyKey companyKey;
            MulticurrencySetupCriteria multicurrencySetupCriteria;
            MulticurrencySetup[] multicurrencySetupList;
            MulticurrencySetup multicurrencySetup;

            // Create an instance of the service
            DynamicsGP wsDynamicsGP = new DynamicsGP();

            // Be sure that default credentials are being used
            wsDynamicsGP.UseDefaultCredentials = true;

            // Create a context with which to call the service
            context = new Context();

            // Create a company key (sample company)
            companyKey = new CompanyKey();
            companyKey.Id = (-1);

            // Set up the context
            context.OrganizationKey = companyKey;

            // Create the criteria, which in this case are empty
            multicurrencySetupCriteria = new MulticurrencySetupCriteria();

            // Get the list of Multicurrency Setup objects
            multicurrencySetupList = wsDynamicsGP.GetMulticurrencySetupList
            (multicurrencySetupCriteria, context);

            // Retrieve the one item from the list
            if (multicurrencySetupList.Length > 0)
            {
                multicurrencySetup = multicurrencySetupList[0];
                MessageBox.Show(multicurrencySetup.Key.CurrencyKey.ISOCode);
            }
        }
    }
}

Cc508497.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)
        {
            Context context;
            CompanyKey companyKey;
            MulticurrencySetupCriteria multicurrencySetupCriteria;
            MulticurrencySetup[] multicurrencySetupList;
            MulticurrencySetup multicurrencySetup;

            // Create an instance of the service
            DynamicsGPClient wsDynamicsGP = new DynamicsGPClient();

            // Create a context with which to call the service
            context = new Context();

            // Create a company key (sample company)
            companyKey = new CompanyKey();
            companyKey.Id = (-1);

            // Set up the context
            context.OrganizationKey = companyKey;

            // Create the criteria, which in this case are empty
            multicurrencySetupCriteria = new MulticurrencySetupCriteria();

            // Get the list of Multicurrency Setup objects
            multicurrencySetupList = wsDynamicsGP.GetMulticurrencySetupList
            (multicurrencySetupCriteria, context);

            // Retrieve the one item from the list
            if (multicurrencySetupList.Length > 0)
            {
                multicurrencySetup = multicurrencySetupList[0];
                MessageBox.Show(multicurrencySetup.Key.CurrencyKey.ISOCode);

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