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

Script to sum fields

New Here ,
Jun 24, 2021 Jun 24, 2021

Copy link to clipboard

Copied

Hi everyone.  You were all very helpful in one of my previous posts and I tried to take that information and adjust it to fit my new scenario but unfortunately seem to be running into a problem.

 

I want it to look to see if the date is filled in and if so take the total number of hours and multiply it by the pay rate.  Here is what I did:

 

if (this.getField("Date1").valueAsString=="") event.value = "";
else event.value = Number(this.getField("Hours1").valueAsString) x Number(this.getField("Pay Rate1").valueAsString);

 

Date is formated as Date and then Hours, Pay Rate and Total are all formatted as Number.

 

Any help is again appreciated.  Thanks

TOPICS
JavaScript

Views

976

Translate

Translate

Report

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 24, 2021 Jun 24, 2021

Copy link to clipboard

Copied

To multiply values use * not x

Votes

Translate

Translate

Report

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
New Here ,
Jun 24, 2021 Jun 24, 2021

Copy link to clipboard

Copied

Thank you.  I corrected that and now I'm getting an error:

 

The value entered does not match the format of the field [Total1]

 

I did make sure that the fields were formatted correctly and that Total1 was in fact a Number.

Votes

Translate

Translate

Report

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 24, 2021 Jun 24, 2021

Copy link to clipboard

Copied

LATEST

What does you get when you change the format of this field to None?

Votes

Translate

Translate

Report

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