I have added a fragment validator which is working as expected.
I would to change the Invalid format message that is shown to something more suitable to the user such as Please remove ‘{ENTER REQUEST}’ and provide a proper task description
Is this possible, and if so where do I set this message?
I couldnt find anything in documentation related to Fragment Validation setup.
Thanks JonathanFS
Whoops found it.
Help Portal
/**
* Fragment Validator: Fragement Validator - Task Description containing {ENTER REQUEST} is Invalid
*/
return {
/**
* @param {fragment_presenter} Fragment instance
*/
main: function(fragment_presenter) {
//cs.log('*** Fragement Validator - Task Description containing {ENTER REQUEST} is Invalid ***');
var value = fragment_presenter.get_value();
if (value.includes('{ENTER REQUEST}')) {
return {
valid: false,
error: "Please remove '{ENTER REQUEST}' and provide a proper task description."
};
}
return {
valid: true
};
}
}
FYI, there is also a simpler shorthand version where you can just return the desired error string. E.g.
return "Please remove '{ENTER REQUEST}' and provide a proper task description.";
1 Like