GetApplicantSkillByKey


Description

Retrieves a single applicant skill object based on the key value supplied.

Parameters

Parameter

Type

Description

key

ApplicantSkillKey

The applicant skill key object that specifies the applicant skill object to retrieve.

context

Context

Specifies information about how the method will be called.


Return Value:

Value

Type

Description

GetApplicantSkillByKeyResult

ApplicantSkill

An applicant skill object.


Interfaces

 

Examples

The following C# example retrieves the applicant skill object with the specifed applicant skill key. The comment for the applicant skill object is displayed in a message box.

 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;
			ApplicantSkill applicantSkill;
			ApplicantKey applicantKey;
			SkillKey skillKey;
			ApplicantSkillKey applicantSkillKey;

			// 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);

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

			// Create an applicant key
			applicantKey = new ApplicantKey();
			applicantKey.Id = 1;

			// Create a skill key
			skillKey = new SkillKey();
			skillKey.Id = "New test skill";

			// Create an applicant skill key
			applicantSkillKey = new ApplicantSkillKey();
			applicantSkillKey.ApplicantKey = applicantKey;
			applicantSkillKey.SkillKey = skillKey;

			// Retrieve the applicant skill object
			applicantSkill = wsDynamicsGP.GetApplicantSkillByKey(applicantSkillKey, context);

			// Display the comments for the specified applicant skill object
			MessageBox.Show(applicantSkill.Comments);
	}
}
}

 Native endpoint

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DynamicsGPWebServiceSample.DynamicsGPService;

namespace DynamicsGPWebServiceSample
{
	class Program
	{
		static void Main(string[] args)
		{
			CompanyKey companyKey;
			Context context;
			ApplicantSkill applicantSkill;
			ApplicantKey applicantKey;
			SkillKey skillKey;
			ApplicantSkillKey applicantSkillKey;

			// 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
			context.OrganizationKey = (OrganizationKey)companyKey;

			// Create an applicant key
			applicantKey = new ApplicantKey();
			applicantKey.Id = 1;

			// Create a skill key
			skillKey = new SkillKey();
			skillKey.Id = "New test skill";

			// Create an applicant skill key
			applicantSkillKey = new ApplicantSkillKey();
			applicantSkillKey.ApplicantKey = applicantKey;
			applicantSkillKey.SkillKey = skillKey;

			// Retrieve the applicant skill object
			applicantSkill = wsDynamicsGP.GetApplicantSkillByKey(applicantSkillKey, context);

			// Display the comments for the specified applicant skill object
			MessageBox.Show(applicantSkill.Comments);

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


Documentation Feedback