Human Capital Management Apex API Developer Reference

vanahcm.JobRequisitionService

global with sharing class JobRequisitionService

Represents a Job Requisition service structure

Methods

create

global static List<ID> create(List<vanahcm.CommonService.JobRequisition> jobRequisitions)

Insert Job Requisitions

Input Parameters

Name Type Description
jobRequisitions List<vanahcm.CommonService.JobRequisition> Job Requisition 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.JobRequisition jobRequisition = new vanahcm.CommonService.JobRequisition();
jobRequisition.Name = 'jobOpening';

List<vanahcm.CommonService.JobRequisition> jobRequisitions = new List<vanahcm.CommonService.JobRequisition>();
jobRequisitions.add(jobRequisition);

List<ID> resultIds = vanahcm.JobRequisitionService.create(jobRequisitions);

modify

global static List<ID> modify(List<vanahcm.CommonService.JobRequisition> jobRequisitions)

Insert or update Job Requisitions

Input Parameters

Name Type Description
jobRequisitions List<vanahcm.CommonService.JobRequisition> Job Requisition 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.JobRequisition jobRequisition = new vanahcm.CommonService.JobRequisition();
jobRequisition.Id = 'a2J15000000p5lR';
jobRequisition.Name = 'jobOpening';

List<vanahcm.CommonService.JobRequisition> jobRequisitions = new List<vanahcm.CommonService.JobRequisition>();
jobRequisitions.add(jobRequisition);

List<ID> resultIds = vanahcm.JobRequisitionService.modify(jobRequisitions);

getByTitle

global static List<vanahcm.CommonService.JobRequisition> getByTitle(Set<String> titles, Set<Schema.SObjectField> customFields)

Get JobRequisition records based on job requisition titles

Input Parameters

Name Type Description
titles Set<String> Title of job requisition records that need to be returned
customFields Set<Schema.SObjectField> Set of custom fields that need to be queried for Job Requisition

Return Value

List of JobRequisition

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> titles = new Set<String>();
titles.add('jobOpening');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Opening__c.CreatedById};

List<vanahcm.CommonService.JobRequisition> jobRequisitions = vanahcm.JobRequisitionService.getByTitle(titles, customFields);

getByPostingDate

global static List<vanahcm.CommonService.JobRequisition> getByPostingDate(Set<Date> dates, Set<Schema.SObjectField> customFields)

Get JobRequisition records based on job requisition posting dates

Input Parameters

Name Type Description
dates Set<Date> Posting date of job requisition records that need to be returned
customFields Set<Schema.SObjectField> Set of custom fields that need to be queried for Job Requisition

Return Value

List of JobRequisition

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<Date> postingDates = new Set<Date>();
Date postDate = Date.newInstance(2023, 09, 8);
postingDates.add(postDate);

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Opening__c.CreatedById};

List<vanahcm.CommonService.JobRequisition> jobRequisitions = vanahcm.JobRequisitionService.getByPostingDate(postingDates, customFields);

getByLocationId

global static List<vanahcm.CommonService.JobRequisition> getByLocationId(Set<ID> locationIds, Set<Schema.SObjectField> customFields)

Get job requisition records based on job requisition location ID

Input Parameters

Name Type Description
locationIds Set<ID> Location ID of job requisition records that need to be returned
customFields Set<Schema.SObjectField> Set of custom fields that need to be queried for Job Requisition

Return Value

List of JobRequisition

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> locationIds = new Set<ID>();
jobRequisitionIds.add('a0nj000000KcOqN');

Set<Schema.SOjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Opening__c.CreatedById};

List<vanahcm.CommonService.JobRequisition> jobRequisitions = vanahcm.JobRequisitionService.getByLocationId(locationIds, customFields);

getByJobOpeningId

global static List<vanahcm.CommonService.JobRequisition> getByJobOpeningId(Set<String> jobOpeningIds, Set<Schema.SObjectField> customFields)

Get job requisition records based on job requisition job opening ID

Input Parameters

Name Type Description
jobOpeningIds Set<String> Job Opening ID of job requisition records that need to be returned
customFields Set<Schema.SObjectField> Set of custom fields that need to be queried for Job Requisition

Return Value

List of JobRequisition

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> jobOpeningIds = new Set<String>();
jobOpeningIds.add('00003');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Opening__c.CreatedById};

List<vanahcm.CommonService.JobRequisition> jobRequisitions = vanahcm.JobRequisitionService.getByJobOpeningId(jobOpeningIds, customFields);

getById

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

Get job requisition records based on job requisition ID

Input Parameters

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

Return Value

List of JobRequisition

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> jobRequisitionIds = new Set<ID>();
jobRequisitionIds.add('a0nj000000KcOqN');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Job_Opening__c.CreatedById};

List<vanahcm.CommonService.JobRequisition> jobRequisitions = vanahcm.JobRequisitionService.getById(jobRequisitionIds, customFields);
© Copyright 2009–2019 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.