Retrieves a list of applicant work history objects that match the specified criteria.
Parameter |
Type |
Description |
---|---|---|
criteria |
The applicant work history criteria object that specifies which applicant work history objects are returned. |
|
context |
Specifies information about how the method will be called. |
Value |
Type |
Description |
---|---|---|
GetApplicantWorkHistoryListResult |
The list of applicant test objects that match the specified criteria. |
The following C# example retrieves the list of applicant work history objects where the employer value is “Previous employer”. The number of applicant work history objects that match the criteria 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; ApplicantWorkHistory[] applicantWorkHistory; ApplicantWorkHistoryCriteria applicantWorkHistoryCriteria; LikeRestrictionOfString employerRestriction; // 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 which company to use (sample company) companyKey = new CompanyKey(); companyKey.Id = (-1); // Set up the context object context.OrganizationKey = (OrganizationKey)companyKey; // Specify the criteria of the applicant work history objects to retrieve employerRestriction = new LikeRestrictionOfString(); employerRestriction.EqualValue = "Previous employer"; applicantWorkHistoryCriteria = new ApplicantWorkHistoryCriteria(); applicantWorkHistoryCriteria.Employer = employerRestriction; // Retrieve the list of applicant work history objects applicantWorkHistory = wsDynamicsGP.GetApplicantWorkHistoryList(applicantWorkHistoryCriteria, context); // Display the number of applicant work history objects that match the criteria MessageBox.Show("The number of applicants from the specified employer: " + applicantWorkHistory.Length.ToString()); } } }
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; ApplicantWorkHistory[] applicantWorkHistory; ApplicantWorkHistoryCriteria applicantWorkHistoryCriteria; LikeRestrictionOfstring employerRestriction; // 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 object context.OrganizationKey = (OrganizationKey)companyKey; // Specify the criteria of the applicant work history objects to retrieve employerRestriction = new LikeRestrictionOfstring(); employerRestriction.EqualValue = "Previous employer"; applicantWorkHistoryCriteria = new ApplicantWorkHistoryCriteria(); applicantWorkHistoryCriteria.Employer = employerRestriction; // Retrieve the list of applicant work history objects applicantWorkHistory = wsDynamicsGP.GetApplicantWorkHistoryList(applicantWorkHistoryCriteria, context); // Display the number of applicant work history objects that match the criteria MessageBox.Show("The number of applicants from the specified employer: " + applicantWorkHistory.Length.ToString()); // Close the service if(wsDynamicsGP.State != CommunicationState.Faulted) { wsDynamicsGP.Close(); } } } }