Hi guys,
I’m trying to figure out how to make this work:
- I have a CheckMark field
- and would like to make value in a Date field change
- when the CheckMark field is Checked
I’ve tried different Script Approaches, with no luck so far
How would I do this?
kr.
John
Hi John,
What script have you written to do this?
Something like this should work:
function setCurrentDate() {
var check_field_id = "fld-.....";
var date_field_id = "fld-....";
var check_value = record.getFieldValue(check_field_id);
if (check_value == 1) {
record.setFieldValue(date_field_id, new Date());
}
form.saveAllChanges();
}
setCurrentDate();
-
This reply was modified 1 year, 3 months ago by Brendan.
-
This reply was modified 1 year, 3 months ago by Brendan.
Hi Brendan,
thanks for your reply – I don’t recall at the moment what I tried, but from what I can read out of your Script I did get the check-field syntax wrong, since I worked with true/false instead of 0/1.
It’s a bit late here in Denmark right now, but I’ll have a play with your script first thing in the morning.
Thanks,
John.
Works like a clock :)
Another Question:
Is it possible to make fields visible depending on values in other fields (conditional)?
kr, J-)
Hi John,
Well, sort of. But because fields are on a form basis, if you hide a field in one record, it will hide that field for every record.
field.hideField = true;