Restrict backdated hiring based on role and legal entity
Summary: Restrict backdated hiring based on role and legal entity
Content (please ensure you mask any confidential information):
Hi all, I have used the below JS to restrict backdated hiring. Hire an employee and add pending worker. I would like to know how can we include the Role and Legal Entity condition in the same.
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
*
- @param {object} context
- @
*/
function runCondition(context) {
const { $componentContext, $fields, $modules, $user } = context;
const date = new Date(new Date().toISOString().substring(0, 10));
if (new Date($fields.actionOccurrences.ActionDate.$value()).getTime() < date.getTime()) {
return true;
}
return false;
}
return { runCondition };
});
Version (include the version you are using, if applicable):
Tagged:
0