add the same script to the new field but add the following (payday is the next 0-13 field)
and change the add+ field to
and finally change billingcycledate field to reference the new payday date field.
1 person found this helpful
OK, this gave me a result... but it was a result of X number of days from today (rather than from the result of "RESULT-A"
Here is what I placed in as my script.
var f = this.getField("DirectDebit_Start");
var g1 = this.getField("Daysuntilstart");
var g = g1.value
var today = new Date();
var add = today.valueOf();
var future = new Date(add);
f.value = util.printd("dd mmmm yyyy", future);
Any thoughts on where I am going wrong? I have tried doing a few different things but I either get no result or I get X days from today's date.
Thanks for your help!
Sorry its actually add+=1000*60*60*24*(g+n) ...theres 1000 miliseconds in a second, 60 seconds in a minute, 60 minutes in an hou,r 24 hours in a day, times how many days out... so the g multiplication would give you how many days untill start... and add the n for days till billing so that the total will give you the date for the bill. I just did the math wrong. Hope this clears it up for you. you could also turn g+n into a variable so that the add+ still ends in a single variable.
Thank you so much! Not only did it clear it up but the explaination ensured I learnt how that calculation works - thank you mate, I truly appreciate your assistance.