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

Dropdown calculation depending product

Community Beginner ,
Aug 03, 2023 Aug 03, 2023
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

TOPICS
How to , JavaScript
439
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
1 ACCEPTED SOLUTION
Community Expert ,
Aug 03, 2023 Aug 03, 2023

Remove the ; at the end of the if line.

View solution in original post

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 ,
Aug 03, 2023 Aug 03, 2023

Remove the ; at the end of the if line.

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 ,
Aug 04, 2023 Aug 04, 2023
LATEST

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

Working now!!

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