Now obviously with a click-bait title like this, you have to accept that what is in this article is not documented and therefore not supported in any way. But I figured that you maybe would be interested by the customValidation extension.
As you may already know, there are many different types of custom JavaScript Extension that relate to Inputs – Custom Input, Full Custom Input and a few more that are related – Custom Options, Custom Search and so on. But there is also a hidden one called custom Validation. It’s in the file, but not documented anywhere public.
As the customValidation name suggests, it simply allows you to add a validation to an Input Control. No further work is required other than supplying the validate object key. The user experience will be as standard. So an example would look like this piece of simple code:
OraclePolicyAutomation.AddExtension({
customValidation: function(control, interview) {
if (control.getProperty("name") == "xMyExtension") {
return {
validate: function(el) {
console.log("Starting name:xMyExtension customInput Validate");
if (el== 'BANANA') {
control.setValue(el);
return;
} else {
return 'PLEASE ENTER BANANA!'
}
console.log("Ending name:xMyExtension customInput Validate");
}
}
}
}
})
So the execution of this customValidation code, tied to a suitable attribute, looks like this:

The cool thing about this custom Validation undocumented extension is that the user experience is standard – no need to implement a mount object key or anything else. Of course, this is not documented and therefore does not exist. But if you happen to have need of it, and want to experiment, go ahead, just remember it is not supported and therefore should not ever be used in production. Until such times as someone says that it is acceptable to do so.
There are several other hidden jewels in the JavaScript Extensions, if there is time one day we will talk about them. Until then they must remain secret 🙂
The documentation of the “official” JavaScript Extensions can be found online here. Have a nice day!