Expand my Community achievements bar.

stop a calculated date from updating each time the form opens

Avatar

Level 3

I have a calculated "read only" Date field, that populates the current date. how do I stop this from re-calculating the date once it is submitted?

3 Replies

Avatar

Level 10

Hi,

There are probably a number of ways of achieving this.

You could wrap the script in an if statement, so that the field will only be populated with the current date if the field is null.

Or you could move the script from the calculate event of the date field into the mouseUp event of the submit button. This is probably the better option.

Hope that helps,

Niall

Assure Dynamics

Avatar

Level 3

Hi Niall,

Is there a way I can change this script (below) to populate the date field only if the form is "dirty", so it will automatically update once something is changed on the form. I just dont know what to put in the Javascript to make it update the date. I only know how to do it automatically in Form Calc

Sample:

var

MyDoc = event.target;

MyDoc.dirty

= true;

app.exec("???");

Avatar

Level 10

Hi,

I don't think that will work very well, because the script updating the date value, will set the dirty flag to true again and you will end up in a continuous loop.

Niall