Copy link to clipboard
Copied
Good evening, I have created a script to spell check a very large list of medications and cancers for our company.
I have created a loop to make all the fields lowercase, before spell checking the document.... However, the fields are being made to lowercase, and then I am prompted the error:
"InvalidSetError: Set not possible, invalid or unknown.
Field.value:22:Batch undefined:Exec"
Here is my code for the loops:
for (i = 0; i < this.numFields; i++) {
var AllFields = this.getField(this.getNthFieldName(i));
AllFields.value = AllFields.valueAsString.toLowerCase();
}
spell.addWord(items);
spell.check();
for (i = 0; i < this.numFields; i++) {
var AllFields = this.getField(this.getNthFieldName(i));
AllFields.value = AllFields.valueAsString.toUpperCase();
}
Any help would be greatly appreciated!
Not all field types have a value property... Specifically, button fields don't have one.
So you need to add a condition in your code that checks the field's type before trying to change its value.
Copy link to clipboard
Copied
Not all field types have a value property... Specifically, button fields don't have one.
So you need to add a condition in your code that checks the field's type before trying to change its value.