Skip to main content
Larry28074460yu0l
Participant
August 4, 2023
Answered

Dropdown calculation depending product

  • August 4, 2023
  • 1 reply
  • 548 views
var qty = Number(this.getField("Q9").valueAsString);
var sys = Number(this.getField("System").valueAsString);
var labor1 = 550;
var labor2 = 495;

if (this.getField("System").valueAsString == "EX500" || this.getField("System").valueAsString == "FS200" || this.getField("System").valueAsString == "TOPOLYZER" || this.getField("System").valueAsString == "LenSx");
event.value = qty * labor1;
else
event.value = qty * labor2;

Im trying to do a simple script that will charge labor and travel depending on what system is selected from dropdown menu. 4 of the systems charge 550 and the rest 495. I had created an OR statement to determine if the charge is 550 or 495, but it fails in the else portion, so I guess the OR statement is being ignored. Maybe Im missing a true/false line but Im not versed enough in script to know The script is in SUB9 and SUB10

This topic has been closed for replies.
Correct answer Bernd Alheit

Remove the ; at the end of the if line.

1 reply

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
August 4, 2023

Remove the ; at the end of the if line.

Larry28074460yu0l
Participant
August 4, 2023

wow Danke Bernd. I cant believe this (;) caused so much grief 👍

Working now!!