Copy link to clipboard
Copied
Hello Everybody,
Trying to create a custom calculation to where i can enter a date (contract Date Box), and the 2 boxes i want (minor Inspection, Major inspection) to automatically fill in will add 6months (minor Inspection) and 12months (major Inspection) from the date that was entered (contract Date). Here is a picture if i cant explain well.
Copy link to clipboard
Copied
Use this as 'validation' script of "Contract Date" field and change if needed "mm/dd/yyyy" to the date format you use:
var days = util.scand("mm/dd/yyyy", event.value)
if(event.value == ""){
this.getField("Minor Inspection").value = "";
this.getField("Major Inspection").value = "";}
else{
var month = util.scand("mm/dd/yyyy", event.value)
month.setMonth(month.getMonth() +6);
this.getField("Minor Inspection").value = util.printd("mm/dd/yyyy", month);
var year = util.scand("mm/dd/yyyy", event.value)
year.setFullYear(year.getFullYear() +1);
this.getField("Major Inspection").value = util.printd("mm/dd/yyyy", year);}