Human Capital Management API Developer Reference

vanahcm.JobApplicationService

global with sharing class JobApplicationService

Represents a Job Application service structure

Methods

getById

global static List<vanahcm.CommonService.JobApplication> getById(Set<ID> ids, Set<Schema.SObjectField> customFields)

Get job application records based on job application ID

Input Parameters

Name Type Description
ids Set<ID> ID of job application records that need to be returned
customFields Set<Schema.SObjectField> Collection of custom fields that need to be queried for Job Application

Return Value

List of JobApplication

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<Id> jobApplicationIds = new Set<Id>();
jobApplicationIds.add('a1qj0000001Fgqt');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Application__c.vanahcm__Number__c};

List<vanahcm.CommonService.JobApplication> jobApplications = vanahcm.JobApplicationService.getById(jobApplicationIds, customFields);

getByCandidate

global static List<vanahcm.CommonService.JobApplication> getByCandidate(Set<ID> ids, Set<Schema.SObjectField> customFields)

Get job application records based on job application's candidate ID

Input Parameters

Name Type Description
ids Set<ID> ID of the candidate whose job application records need to be returned
customFields Set<Schema.SObjectField> Collection of custom fields that need to be queried for Job Application

Return Value

List of JobApplication

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<Id> candidateIds = new Set<Id>();

//Add CandidateId of vanahcm__Job_Application__c to candidateIds
candidateIds.add('a1qj0000001Fgqt');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Application__c.vanahcm__Number__c};

List<vanahcm.CommonService.JobApplication> jobApplications = vanahcm.JobApplicationService.getByCandidate(candidateIds, customFields);

getByCandidateEmail

global static List<vanahcm.CommonService.JobApplication> getByCandidateEmail(Set<String> emails, Set<Schema.SObjectField> customFields)

Get job application records based on job application's candidate email

Input Parameters

Name Type Description
emails Set<String> Email of job applications candidate records that need to be returned
customFields Set<Schema.SObjectField> Collection of custom fields that need to be queried for Job Application

Return Value

List of JobApplication

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<String> candidateemails = new Set<String>();

//Add Email of vanahcm__Job_Application__c to emails
candidateemails.add('foo@bar.com');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Application__c.vanahcm__Number__c};

List<vanahcm.CommonService.JobApplication> jobApplications = vanahcm.JobApplicationService.getByCandidateEmail(candidateemails, customFields);

getByApplicantId

global static List<vanahcm.CommonService.JobApplication> getByApplicantId(Set<String> applicantIds, Set<Schema.SObjectField> customFields)

Get job application records based on job application's applicant ID

Input Parameters

Name Type Description
applicantIds Set<String> Applicant ID of job application records that need to be returned
customFields Set<Schema.SObjectField> Collection of custom fields that need to be queried for Job Application

Return Value

List of JobApplication

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<String> applicantIds = new Set<String>();

//Add Applicant Id of vanahcm__Job_Application__c to applicantIds
applicantIds.add('23');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Application__c.vanahcm__Number__c};

List<vanahcm.CommonService.JobApplication> jobApplications = vanahcm.JobApplicationService.getByApplicantId(applicantIds, customFields);

getByJobOpening

global static List<vanahcm.CommonService.JobApplication> getByJobOpening(Set<ID> ids, Set<Schema.SObjectField> customFields)

Get job application records based on job application's job opening ID

Input Parameters

Name Type Description
ids Set<ID> ID of job application's job opening records that need to be returned
customFields Set<Schema.SObjectField> Collection of custom fields that need to be queried for Job Application

Return Value

List of JobApplication

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<Id> jobOpeningIds = new Set<Id>();

//Add JobOpeningId of vanahcm__Job_Application__c to jobOpeningIds
jobOpeningIds.add('a1qj0000001Fgqt');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Application__c.vanahcm__Number__c};

List<vanahcm.CommonService.JobApplication> jobApplications = vanahcm.JobApplicationService.getByJobOpening(jobOpeningId, customFields);

create

global static List<ID> create(List<vanahcm.CommonService.JobApplication> jobApplications)

Insert job applications

Input Parameters

Name Type Description
jobApplications List<vanahcm.CommonService.JobApplication> Job Application records that need to be inserted

Return Value

List of ID

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

vanahcm.CommonService.JobApplication jobApplication = new vanahcm.CommonService.JobApplication();
jobApplication.JobOpening = 'a0nj000000KcOqN';
jobApplication.Candidate = 'a0nj000000KceqN';

List<vanahcm.CommonService.JobApplication> jobApplications = new List<vanahcm.CommonService.JobApplication>();
jobApplications.add(jobApplication);

List<ID> results = vanahcm.JobApplicationService.create(jobApplications);

modify

global static List<ID> modify(List<vanahcm.CommonService.JobApplication> jobApplications)

Insert or update job applications

Input Parameters

Name Type Description
jobApplications List<vanahcm.CommonService.JobApplication> Job Application records that need to be inserted or updated

Return Value

List of ID

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

vanahcm.CommonService.JobApplication jobApplication = new vanahcm.CommonService.JobApplication();
jobApplication.Id = 'a20xs00230234sde';
jobApplication.JobOpening = 'a0nj000000KcOqN';
jobApplication.Candidate = 'a0nj000000KceqN';

List<vanahcm.CommonService.JobApplication> jobApplications = new List<vanahcm.CommonService.JobApplication>();
jobApplications.add(jobApplication);

List<ID> results = vanahcm.JobApplicationService.modify(jobApplications);