Skip to main content
SIH007_1
Participant
June 12, 2025
Question

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

  • June 12, 2025
  • 2 replies
  • 288 views

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.
 
 

 

2 replies

PDF Automation Station
Community Expert
Community Expert
June 13, 2025

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().

SIH007_1
SIH007_1Author
Participant
June 14, 2025

Cool, thank you very much!

try67
Community Expert
Community Expert
June 12, 2025

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.