我想创建一个项目工作流程,它将在创建项目期间设置一些默认值。问题是我希望这种情况只发生在某些子公司。我不认为“子公司”是“条件”字段的可能标准。
这有点奇怪。如果工作流程应该在“提交后”触发,而子公司应该了解工作流程,我希望此功能可用。
getFieldValue()
方法获取子公司字段并将其与所需的子公司进行比较。工作流程动作脚本中的辅助检查脚本:
function beforeSubmitAction(context) {
var newRecord = context.newRecord;
var subsidiaryId = newRecord.getValue('subsidiary'); // Fetch the subsidiary ID
var allowedSubsidiaries = [1, 2, 3]; // List of subsidiary internal IDs
// Check if the subsidiary matches the allowed subsidiaries
if (allowedSubsidiaries.indexOf(subsidiaryId) !== -1) {
newRecord.setValue('customfield', 'defaultValue'); // Set your default values here
}
}