Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Greater than & If statement

New Here ,
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

37

Likes

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
Adobe Community Professional ,
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));

}

 

Likes

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

Copy link to clipboard

Copied

Thanks for that. 

 

All good. 

 

Cheers

LC

Likes

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

Copy link to clipboard

Copied

You're welcome.

Likes

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?

Likes

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