Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Jun 12, 2025 Jun 12, 2025

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.
 
 

 

TOPICS
JavaScript
149
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2025 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2025 Jun 12, 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().

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 14, 2025 Jun 14, 2025
LATEST

Cool, thank you very much!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines