Skip to main content
SIH007_1
Participant
Jun 12, 2025 9:02 PM UTC
Question

TypeError: this.getField(...) is null

Ich habe folgendes Script 

function StatusPruefen()
{
     ccField = this.getField("cContact");
     if(ccField.value.length == 1)
     {
          this.getField(ccField).focus();
     }
}
StatusPruefen();
im Bereich Dokumente.  Beim Ausführen bekomme ich die Fehlermeldung 
TypeError: this.getField(...) is null
Ich habe als Erklärung nur gefunden, dass der Feldname falsch sein soll oder das Feld gar nicht existiert. Das ist hier nicht so, das Feld existiert unter dem angegebenen Namen auf S. 3.
 
 

 

3 replies

PDF Automation Station
Community Expert
Community Expert
Jun 13, 2025 1:25 AM UTC

You are attempting to pass a field object as the field name.  It should be one of these:

ccField = "cContact";

then

this.getField(ccField)

OR

ccField = this.getField("cContact");

then

ccField.focus();

Also, the field method is setFocus(), Not, focus().

Translate
SIH007_1
SIH007_1Author
Participant
Jun 14, 2025 12:20 PM UTC

Cool, thank you very much!

Translate
try67
Community Expert
Community Expert
Jun 12, 2025 10:44 PM UTC

Are you 100% sure you spelled it correctly? It's case-sensitive (so "cContact" and "CContact" are not the same), and even a single character off (like a space or a period) will cause it not to work.
If you still can't solve it, please share the file for further help.

Translate