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 skill set object based on the specified skill set key.
Parameters
Parameter |
Type |
Description |
|---|---|---|
key |
The skill set key object that specifies the skill set object to retrieve. |
|
context |
Specifies information about how the method will be called. |
Return Value:
Value |
Type |
Description |
|---|---|---|
GetSkillSetByKeyResult |
A skill set object. |
Interfaces
- Dynamics GP
- Human Resources/Payroll
Examples
The following C# example retrieves a skill set object with the key value "New test skill set". A message box displays the number of skills associated with the specified skill set.
** 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;
SkillSet skillSet;
SkillSetKey skillSetKey;
// 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();
// Specify which company to use (sample company)
companyKey = new CompanyKey();
companyKey.Id = (-1);
// Create a skill set key
skillSetKey = new SkillSetKey();
skillSetKey.Id = "New test skill set";
// Retrieve the skill set object
skillSet = wsDynamicsGP.GetSkillSetByKey(skillSetKey, context);
// Display the number of skills associated with the skill set
MessageBox.Show("The skill set includes the following number of skills : " +
skillSet.AvailableSkills.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;
SkillSet skillSet;
SkillSetKey skillSetKey;
// 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);
// Create a skill set key
skillSetKey = new SkillSetKey();
skillSetKey.Id = "New test skill set";
// Retrieve the skill set object
skillSet = wsDynamicsGP.GetSkillSetByKey(skillSetKey, context);
// Display the number of skills associated with the skill set
MessageBox.Show("The skill set includes the following number of skills : " +
skillSet.AvailableSkills.ToString());
// Close the service
if(wsDynamicsGP.State != CommunicationState.Faulted)
{
wsDynamicsGP.Close();
}
}
}
}