Highlighted

Simplified Field Notation (Subtraction) and setting a range

Explorer ,
Nov 13, 2020

Copy link to clipboard

Copied

Hi all,

 

Have a problem - have a field (C) that calculates the simplified field notation (A-B). This all works fine, but what I need to do is allow the calculation to do what it does, but one it reaches a certain value (3500.0), the subsequent figures in excess of this figure should not populate the (C) field, and it should remain fixed at 3500.0. If the calculation (A-B) then drops below this 3500.0 threshold, the calculation should resume in calculating the (A-B) in the normal way....possible with script??

 

Thanks

See if this works for you, put it in "C" field as "Custom Calculation Script":

var a = this.getField("A").value;
var b = this.getField("B").value;
var c = a-b;
if(c >= 3500.0){
event.value = 3500.0;}
else event.value = c;

TOPICS
PDF forms

Views

26

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

Simplified Field Notation (Subtraction) and setting a range

Explorer ,
Nov 13, 2020

Copy link to clipboard

Copied

Hi all,

 

Have a problem - have a field (C) that calculates the simplified field notation (A-B). This all works fine, but what I need to do is allow the calculation to do what it does, but one it reaches a certain value (3500.0), the subsequent figures in excess of this figure should not populate the (C) field, and it should remain fixed at 3500.0. If the calculation (A-B) then drops below this 3500.0 threshold, the calculation should resume in calculating the (A-B) in the normal way....possible with script??

 

Thanks

See if this works for you, put it in "C" field as "Custom Calculation Script":

var a = this.getField("A").value;
var b = this.getField("B").value;
var c = a-b;
if(c >= 3500.0){
event.value = 3500.0;}
else event.value = c;

TOPICS
PDF forms

Views

27

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
Nov 13, 2020 0
Engaged ,
Nov 13, 2020

Copy link to clipboard

Copied

See if this works for you, put it in "C" field as "Custom Calculation Script":

var a = this.getField("A").value;
var b = this.getField("B").value;
var c = a-b;
if(c >= 3500.0){
event.value = 3500.0;}
else event.value = c;

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
Reply
Loading...
Nov 13, 2020 1
Explorer ,
Nov 13, 2020

Copy link to clipboard

Copied

Nesa, thats genius! many thanks for that, works beautifully!!!

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
Reply
Loading...
Nov 13, 2020 0