GetApplicantInterviewByKey


Description

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

Parameters

Parameter

Type

Description

key

ApplicantInterviewTypeKey

The applicant interview type key object that specifies the applicant interview object to retrieve.

context

Context

Specifies information about how the method will be called.


Return Value:

Value

Type

Description

GetApplicantInterviewByKeyResult

ApplicantInterview

An applicant interview object.


Interfaces

 

Examples

The following C# example retrieves the applicant interview object with an application key value of “1”, an interviewType key of “test”, and an apply date key equal to the current date. The interview notes from the specified applicant interview object are 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;
			ApplicantInterview applicantInterview;
			ApplicantKey applicantKey;
			InterviewTypeKey interviewTypeKey;
			ApplyDateKey applyDateKey;
			ApplicantInterviewTypeKey applicantInterviewTypeKey;

			// 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 an interview type key
			interviewTypeKey = new InterviewTypeKey();
			interviewTypeKey.Id = "test";

			// Create an apply date key
			applyDateKey = new ApplyDateKey();
			applyDateKey.Id = DateTime.Today; 

			// Create an applicant interview type key
			applicantInterviewTypeKey = new ApplicantInterviewTypeKey();
			applicantInterviewTypeKey.ApplicantKey = applicantKey;
			applicantInterviewTypeKey.InterviewTypeKey = interviewTypeKey;
			applicantInterviewTypeKey.ApplyDateKey = applyDateKey;

			// Retrieve the applicant interview object
			applicantInterview = wsDynamicsGP.GetApplicantInterviewByKey(applicantInterviewTypeKey, context);

			// Display the notes property of the specified applicant interview object
			MessageBox.Show("Interview notes: " + applicantInterview.Notes);
	}
}
}

 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;
			ApplicantInterview applicantInterview;
			ApplicantKey applicantKey;
			InterviewTypeKey interviewTypeKey;
			ApplyDateKey applyDateKey;
			ApplicantInterviewTypeKey applicantInterviewTypeKey;

			// 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 an interview type key
			interviewTypeKey = new InterviewTypeKey();
			interviewTypeKey.Id = "test";

			// Create an apply date key
			applyDateKey = new ApplyDateKey();
			applyDateKey.Id = DateTime.Today; 

			// Create an applicant interview type key
			applicantInterviewTypeKey = new ApplicantInterviewTypeKey();
			applicantInterviewTypeKey.ApplicantKey = applicantKey;
			applicantInterviewTypeKey.InterviewTypeKey = interviewTypeKey;
			applicantInterviewTypeKey.ApplyDateKey = applyDateKey;

			// Retrieve the applicant interview object
			applicantInterview = wsDynamicsGP.GetApplicantInterviewByKey(applicantInterviewTypeKey, context);

			// Display the notes property of the specified applicant interview object
			MessageBox.Show("Interview notes: " + applicantInterview.Notes);

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


Documentation Feedback