How to display dates dynamically

varunkumar1
Tera Contributor

Hi,

I have a requirement explained as below.

I have 3 date fields say (Date A, Date B and Date C) on a form. Based on date selected on Date A, the dates should be set in Date B and Date C.

For Ex: If I select Date A as today(03/17/2017) , then Date B should be set with yesterday's date(03/16/2017) and Date C should be set with "day before yesterday's date" (03/15/2017).

Please help me how can we do this.

12 REPLIES 12

Andrii
Kilo Guru

You need to create GlideDate objects for each field and set date in that object and then assign that value to other field using setValue() method


Hi Andrii,



I am not much familiar with the scripting part in service now. Could you please explain the steps so that would help me out.



Thanks


So, how you going to implement it then? and do you need these fields to be modified immediately while user changes one field or they need to be set after save/update?


When user changes the date in Date A, it should immediately set the dates in Date B and Date C.


The functionality should not happen on save\update.