: Admin: Configure Custom Action Apex Development Guide Actions On Mass Offer Grid View
In order to be executed, the Apex class must extend the ATSActionBase
class and override the execute method:
Copy
public with sharing class ATSActionTest extends ATSActionBase {
public override ATSActionBase.ATSActionResponse execute(List<SObject> records) {
List<Application_V2__c> apps = (List<Application_V2__c>) records;
for (Application_V2__c record : apps) {
record.Salary_Offered__c += 100;
record.Candidate_Summary__c = 'test';
}
// update apps;
// apps = [SELECT Id, Salary_Offered__c, Candidate_Summary__c, TR1__Email__c FROM Application_V2__c WHERE Id IN :apps];
ATSActionBase.ATSActionResponse response = new ATSActionBase.ATSActionResponse();
response.records = apps;
response.isSuccess = true;
response.showToast = true;
response.message = '1 of 2 records has been recalculated';
response.messageType = 'warning';
return response;
}
}
Parameters
List<SObject>
: Contains the list ofApplication First stage of Job placement flow (Application> Submittal>Interview>Offer> Placement)_V2__c
records with the fields that are displayed in the table.- When called from
Apply To Other Job A job (vacancy, position, role) is an opening for which a customer's client needs a placement.
action, application records do not have Id yet but can be identified by TR1__Applicant A person looking for a job. A candidate can also be referred to as a Job Seeker, Applicant, or Provider.__c and TR1__Job__c fields.
- When called from
Returns
ATSActionBase.ATSActionResponse
object, where:records
: List of updated SObject records, Application_V2__c in case of Mass Offer The fourth Stage of Job application flow. This is when the candidate is offered the position (details about salary, locations etc are shared and candidate decides if he wants to take the job) - Grid.- Field values from these records will be populated into the table.
isSuccess
: Indicates if the operation is successful.- If set to
false
, the table is not being updated.
- If set to
showToast
: If set totrue
, the toast message will be displayed with message and messageType.- If not provided,
ATSSuccess/ATSError
labels are used for the message and success/error message type based on the isSuccess value.
- If not provided,
message
: Message text for the toast messagemessageType
: Type of the toast message.- Supports following values: success, error, info, warning
After the apex action execution formula field recalculation is not triggered and thus formula fields should be recalculated by the apex class itself.
Was this helpful?
No