Copy link to clipboard
Copied
I am having issues with this script. The custom calucation scirpt that I put in is correct and when I go to preview and drop down my first box and click on a product the second box next to it changes to the formula I am needing. BUT when I go to the drop down on the second box and click on the correct option it goes back to the first product typed in the options of that product. It won't let me choose another one in the drop down menu.. I am hoping someone can help me with this. Sorry if this kind of confusing I am trying to word this in the best way possible. I have also attached a screen shot of the first dropdown and second dropdown.
Copy link to clipboard
Copied
That's because you use script as calculation script, try to use script under 'Validate'.
Copy link to clipboard
Copied
That's because you use script as calculation script, try to use script under 'Validate'.
Copy link to clipboard
Copied
Can I please get help with a custom calculation?
I have a date field for Date of Violation, but I need an auto-calculation for +13 months from the date indicated in Date of Violation.
Would I then put the code under Validate or Calculate?
Copy link to clipboard
Copied
What are the names of your fields?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Try using the following as a custom validation script for the "Date17_af_date" field.
If you're using a different date format, make sure to update "mm/dd/yyyy" accordingly. Otherwise, you can leave it as is:
var m13 = this.getField("Date18_af_date");
if(event.value == "")
m13.value = "";
else{
var date = util.scand("mm/dd/yyyy", event.value);
date.setMonth(date.getMonth() + 13);
m13.value = util.printd("mm/dd/yyyy", date);}
Copy link to clipboard
Copied
It didn't work :(. I verified I was using the same format indicated (mm/dd/yyyy). Then I copied and pasted the code into the "Run custom validation script" in "Date18_af_date". Did I do that right?
What I would ike to happen is someone chooses the date in "Date17_af_date". When they choose the date (I used a Date field) in "Date17_af_date", then a date 13 months after will auto populate in "Date18_af_date". I also used a Date field for "Date18_af_date", should I use something different like a Text box instead?
Copy link to clipboard
Copied
You used script in the wrong field, if you read my post you can see I wrote to put script in "Date17_af_date".
Copy link to clipboard
Copied
THANK YOU VERY MUCH FOR YOU HELP!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more