Skip to main content
Participating Frequently
April 3, 2018
Answered

Stringabfrage

  • April 3, 2018
  • 19 replies
  • 998 views

Hallo zusammen,
hätte mal eine Frage,

A =this.getField("Artikelnummer.0").value.toString;

if (A = "F.800.600") this.getField("Artikelbezeichung.0").value = "PM14/18 FFH 420-800/FFB 370-600",this.getField("Montagezeit.0").value=60, this.getField("Einzelpreis.0").value="103,83";

else if (A = "F.800.800") this.getField("Artikelbezeichung.0").value = "PM14/18 FFH 420-800/FFB 600-800",this.getField("Montagezeit.0").value=60, this.getField("Einzelpreis.0").value="116,73";

wenn ich dann in das Feld Artikelnummer.0 F.800.600 eingebe, werden die Felder nicht automatisch ausgefüllt. wo hab ich den Fehler gemacht?

mfg

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Bernd Alheit

Dann kommt im Debugger auch diese Meldung:

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

3:Field:Calculate


Can you share the form?

19 replies

try67
Community Expert
Community Expert
April 3, 2018

This line is also incorrect:

A = this.getField("Artikelnummer.0").value.toString;

toString is a function. To use it you must call it, like this:

this.getField("Artikelnummer.0").value.toString();

Or simply use:

this.getField("Artikelnummer.0").valueAsString;

Bernd Alheit
Community Expert
Community Expert
April 3, 2018

You must use following:

if (      ) {

command;

command;

command;

} else if (        ) {

command;

command;

command;

}

Participating Frequently
April 3, 2018

Danke ich werde es gleich probieren

try67
Community Expert
Community Expert
April 3, 2018

The comparison operator of JS is " == ", not " = "...

Participating Frequently
April 3, 2018

Danke, aber das funktioniert auch nicht, z.B.: (A=="F.800.600")

try67
Community Expert
Community Expert
April 3, 2018

Each getField command has to be separate. You can't separate them with a

comma in the same line of code.