record.setNoteFieldValue() needs a ‘ in the example.
record.setNoteFieldValue(field_id, ‘note_value’);
Oops. Thanks! I fixed it.
Sorry – also:
document object has a .name property.
(I’m working on an object tutorial and crawling through the API.)
field.defaultValue property needs to be added to documentation.
Oops again. Yes, I just added document.name;
to the manual.
But field.defaultValue;
was already in the documentation.
Thanks! The defaultValue documentation version just hasn’t gotten to me yet, but I used it anyway for faster data entry with a couple sometimes-repetitive fields. I really adore Tap Forms and it’s wonderful that you are actively working on it.
Script field code below is provided for other people who might find it useful. As a record gets added, the default value changes to the current data so it isn’t necessary to enter it on subsequent records unless the value changes (i.e. it’s easy to enter multiple books by the same author purchased in the same year).
function Change_Default_Values() {
var author_id = 'fld-d3d7e4d8d3104c70a002ba5016f597c1';
var year_id = 'fld-a6fa7f9e718640d0b52c6f3baa5a40db';
var author_fld = form.getFieldWithId(author_id);
var year_fld = form.getFieldWithId(year_id);
var author = record.getFieldValue(author_id);
var year = record.getFieldValue(year_id);
if (!author) { author = ""; }
author_fld.defaultValue = author;
year_fld.defaultValue = year;
document.saveAllChanges();
}
Change_Default_Values();
That’s a really cool way of using the default value option to help autofill new records. I might have to pinch that :D
Pinch away! I may include it in the object tutorial, depending on how many examples I get to.