Name - choose the name for the new function.
Template - the template for the function. For example: MONTH(date/string/milliseconds)
Example - regarding previously chosen Template -> MONTH('2015/12/31')
Family - choose from the list:
Description - short description. For example, returns month (from 1 to 12).
Javascript Expression - insert a valid JS function.
For example:
function MONTH(date) {if(date) {if(typeof date === 'string'){date=date.replace(/-/gi,'/');date=date.replace(/./gi,'/');}var d = new Date(date);return d.getMonth()+1;}else return date;}
After creating and saving a new Function, it can be chosen from the list of functions in a DV JS Tests when building Rule(s).
For example: a function "DATEFORMAT2_bnm" was created:
In order to use new function "DATEFORMAT2_bnm" in a DV JS Test, go to "Quality Gates -> My Projects -> specific Project-> Tests section". Enter an existing DV JS Test or create a new one.
Access column's mapping, make sure to uncheck the "SQL Mode" check box:
Click the "Add Rule" button. You can find previously created function "DATEFORMAT2_bnm" in the list of available functions:
The newly created functions can be used in Data Validation Tests, use the following manual for further explanation: Data-Validation-Tests

Comments
0 comments
Please sign in to leave a comment.