Compartilhar via


GetBackOfficeRoleList

Description

Retrieves a list of all of the back office role objects representing each security role defined in Microsoft Dynamics GP.

Parameters

Parameter

Type

Description

context

Context

Specifies information about how the method will be called.

Return Value:

Value

Type

Description

GetBackOfficeRoleListResult

ArrayOfBackOfficeRole

A list of back office role objects representing each security role defined in Microsoft Dynamics GP.

Interfaces

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

Examples

The following C# example retrieves the list of all security roles defined in Microsoft Dynamics GP and displays their names in a message box.

Cc508672.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)
        {
            OrganizationKey organizationKey;
            Context context;
            BackOfficeRole[] backOfficeRoles;

            // 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 the system database
            organizationKey = null;

            // Set up the context object
            context.OrganizationKey = organizationKey;

            // Retrieve the list of back office roles
            backOfficeRoles = wsDynamicsGP.GetBackOfficeRoleList(context);

            // Display the name of each security role in the list
            StringBuilder roleList = new StringBuilder();
            foreach (BackOfficeRole a in backOfficeRoles)
            {
                roleList.AppendLine(a.Name);
            }
            MessageBox.Show(roleList.ToString());
        }
    }
}

Cc508672.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)
        {
            OrganizationKey organizationKey;
            Context context;
            BackOfficeRole[] backOfficeRoles;

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

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

            // Specify the system database
            organizationKey = null;

            // Set up the context object
            context.OrganizationKey = organizationKey;

            // Retrieve the list of back office roles
            backOfficeRoles = wsDynamicsGP.GetBackOfficeRoleList(context);

            // Display the name of each security role in the list
            StringBuilder roleList = new StringBuilder();
            foreach (BackOfficeRole a in backOfficeRoles)
            {
                roleList.AppendLine(a.Name);
            }
            MessageBox.Show(roleList.ToString());

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