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 all of the back office role assignment objects. Each back office role assignment object represents a back office security role that a user in Microsoft Dynamics GP is assigned to.
Parameters
Parameter |
Type |
Description |
|---|---|---|
context |
Specifies information about how the method will be called. |
Return Value:
Value |
Type |
Description |
|---|---|---|
GetBackOfficeRoleAssignmentListResult |
A collection of back office role assignment objects. |
Interfaces
- Dynamics GP
- Common
- Field Service
- Financials
- Human Resources/Payroll
- Inventory
- Manufacturing
- Project Accounting
- Purchasing
- Sales
Examples
The following C# example lists all of the users in Microsoft Dynamics GP and the back office security roles they are assigned to.
** 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;
BackOfficeRoleAssignment[] backOfficeRoleAssignments;
// 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();
// Set up the context object
context.OrganizationKey = null;
// Retrieve the back office role assignments
backOfficeRoleAssignments = wsDynamicsGP.GetBackOfficeRoleAssignmentList(context);
// Display the back office role assignments in the list
StringBuilder roleList = new StringBuilder();
foreach (BackOfficeRoleAssignment a in backOfficeRoleAssignments)
{
// Look up the role
BackOfficeRoleKey roleKey = new BackOfficeRoleKey();
roleKey.Id = a.Key.RoleKey.Id;
BackOfficeRole backOfficeRole;
backOfficeRole = wsDynamicsGP.GetBackOfficeRoleByKey(roleKey, context);
// Add the user and role
roleList.AppendLine(a.Key.UserKey.Id + " " + backOfficeRole.Name);
}
MessageBox.Show(roleList.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)
{
Context context;
BackOfficeRoleAssignment[] backOfficeRoleAssignments;
// Create an instance of the service
DynamicsGPClient wsDynamicsGP = new DynamicsGPClient();
// Create a context with which to call the service
context = new Context();
// Set up the context object
context.OrganizationKey = null;
// Retrieve the back office role assignments
backOfficeRoleAssignments = wsDynamicsGP.GetBackOfficeRoleAssignmentList(context);
// Display the back office role assignments in the list
StringBuilder roleList = new StringBuilder();
foreach (BackOfficeRoleAssignment a in backOfficeRoleAssignments)
{
// Look up the role
BackOfficeRoleKey roleKey = new BackOfficeRoleKey();
roleKey.Id = a.Key.RoleKey.Id;
BackOfficeRole backOfficeRole;
backOfficeRole = wsDynamicsGP.GetBackOfficeRoleByKey(roleKey, context);
// Add the user and role
roleList.AppendLine(a.Key.UserKey.Id + " " + backOfficeRole.Name);
}
MessageBox.Show(roleList.ToString());
// Close the service
if(wsDynamicsGP.State != CommunicationState.Faulted)
{
wsDynamicsGP.Close();
}
}
}
}