Human Capital Management Apex API Developer Reference

vanahcm.ResponseService

global with sharing class ResponseService

Represents a Response service structure

Methods

getById

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

Get response records based on response ID

Input Parameters

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

Return Value

List of Response

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

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Response__c.vanahcm__Response_Text__c};
    
List<vanahcm.CommonService.Response> responses = vanahcm.ResponseService.getById(responseIds, customFields);

getByJobQuestion

global static List<vanahcm.CommonService.Response> getByJobQuestion(Set<ID> jobQuestionIds, Set<Schema.SObjectField> customFields)

Get Response records based on Job Question Id

Input Parameters

Name Type Description
jobQuestionIds Set<ID> ID of job question records
customFields Set<Schema.SObjectField> Collection of custom fields that need to be queried for Response

Return Value

List of Response

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

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Response__c.vanahcm__Response_Text__c};
    
List<vanahcm.CommonService.Response> responses = vanahcm.ResponseService.getByJobQuestion(jobQuestionIds, customFields);

getByJobApplication

global static List<vanahcm.CommonService.Response> getByJobApplication(Set<ID> jobApplicationIds, Set<Schema.SObjectField> customFields)

Get response records based on job application ID

Input Parameters

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

Return Value

List of Response

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('a0pg000000MpOrG');

Set<Schema.SObjectField> customFields = new Set<Schema.SObjectField>{vanahcm__Response__c.vanahcm__Response_Text__c};
    
List<vanahcm.CommonService.Response> response = vanahcm.ResponseService.getByJobApplication(jobApplicationIds, customFields);

create

global static List<ID> create(List<vanahcm.CommonService.Response> responses)

Insert Responses

Input Parameters

Name Type Description
responses List<vanahcm.CommonService.Response> Response 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.Response response = new vanahcm.CommonService.Response();
response.JobApplication = 'a1fj000000103mv';

List<vanahcm.CommonService.Response> responses = new List<vanahcm.CommonService.Response>();
responses.add(response);

List<ID> results = vanahcm.ResponseService.create(responses);

modify

global static List<ID> modify(List<vanahcm.CommonService.Response> responses)

Insert or update Responses

Input Parameters

Name Type Description
responses List<vanahcm.CommonService.Response> Response 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.Response response = new vanahcm.CommonService.Response();

response.Id = 'a0oj0000003nCID';
response.ResponseText = 'Updated Sample response';

List<vanahcm.CommonService.Response> responses = new List<vanahcm.CommonService.Response>();
responses.add(response);

List<ID> results = vanahcm.ResponseService.modify(responses);
© Copyright 2009–2019 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.