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

Greater than & If statement

Explorer ,
Aug 26, 2021 Aug 26, 2021

Copy link to clipboard

Copied

Hi All,

 

I have the following as a custom calculation script in a field called TRANSIT STATIC UKC. Basically i want is, if the field named TRANSIT MAXIMUM DRAFT has a value greater than 10 to return a custom text, if its less than 10 then then a calculation is completed as per below. When I had just the calculation script running all was good, but when I added in the extra bit it all stopped working. 

 

 

if(this.getField("TRANSIT MAXIMUM DRAFT").(event.value > 10)){ app.alert("SEE DUKC CALC"); }else event.value = (Number(this.getField("TRANSIT ACTUAL DEPTH").valueAsString) - Number(this.getField("TRANSIT MAXIMUM DRAFT").valueAsString));

 

Thanks

LC

TOPICS
Edit and convert PDFs , PDF forms

Views

1.1K

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 ,
Aug 26, 2021 Aug 26, 2021

Copy link to clipboard

Copied

There are typos and errors in the syntax.

 

Try your code like this:

 

 

if(this.getField("TRANSIT MAXIMUM DRAFT").value > 10){ 
app.alert("SEE DUKC CALC"); 

} else {

event.value = (Number(this.getField("TRANSIT ACTUAL DEPTH").valueAsString) - Number(this.getField("TRANSIT MAXIMUM DRAFT").valueAsString));

}

 

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
Explorer ,
Aug 27, 2021 Aug 27, 2021

Copy link to clipboard

Copied

Thanks for that. 

 

All good. 

 

Cheers

LC

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 ,
Aug 27, 2021 Aug 27, 2021

Copy link to clipboard

Copied

You're welcome.

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
Enthusiast ,
Aug 27, 2021 Aug 27, 2021

Copy link to clipboard

Copied

LATEST

If calculation takes place and after that you change 'draft' value to be higher then 10 do you still want value from calculation to be visible or field to be empty in that case?

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