How do I add only the fields whose value is greater than an established amount in a calculation?

Andrea444

03-09-2015

I have a Life Cycle Designer PDF form with fields for user input.  I want to add together ONLY the items that are more than $25. Any assistance would be appreciated.

thank you.

Accepted Solutions (1)

Accepted Solutions (1)

XIIIX-inTVbY

08-09-2015

I have fixed it for you - YAY

https://www.dropbox.com/s/zbt89nxk6zv0uq2/EQUALIZERx%289-15%29v2%20data%20ADDED%2001%20DONE.pdf?dl=0

I sympathize with your sentiment regarding MS EXCEL but, ultimately, LiveCycle (and the complex coding requirements) is the only way to deliver solutions that can't be messed up by other people.

I still struggle with 'for' loops - they're not nearly as intuitive as 'if, else' constructs BUT mastering both of these constructs gives you 95% of the functionality you were able to squeeze out of EXCEL.

Articles/examples by BRINKMAN (google FormFeed) and NIALL (google Assure Dynamics) helped me a lot in improving my command of LiveCycle Designer.

Answers (6)

Answers (6)

XIIIX-inTVbY

09-09-2015

Great news - progress is very much about incremental steps -- my understanding is little more than a function of the knowledge of others. Niall has been very generous in providing so many 'worked examples' for LC Designer practioners - visit his website, download some forms and your capabilities will expand massively !!

www.assuredynamics.com

Andrea444

09-09-2015

Woohoo!!! This does works nicely and I have learned some things by reading the code, which I am sure will come up again some time.

Thank you

gkaiseril

09-09-2015

There are way to work around some of these issues with more advance programing.

One can place the values to process into an array, use a filter to remove unwanted items from the array and use a call back function to sum the array.


Andrea444

08-09-2015

 

Hi,

 

I should have probably mentioned that my programming skills are only that which I have had to learn for basic forms, so this is a challenge for me .  http://adobe.ly/1K5ykgK. The item formula that I am stuck on is in trying to resolve Step 3 of the form. I wish it worked like Excel.  That was much easier. 

 

Thank you for your time.

 

XIIIX-inTVbY

07-09-2015

You probably need to run an 'if' statement (to cut out values below $25) AND THEN a 'for loop' to sum the remaining values >>

If you can post a link your form, I'll have a crack at it for you..

gkaiseril

04-09-2015

You need to use the commands for conditional code execution. You can use the JavaScript "if" statement or the FormCalc "if" statement. Note that the syntax for the "if" statement have a different syntax.

The "Scripting Reference" under LiveCycle's Help menu bar item has more information about the FormCalc statements.

Since this is custom scripting you need establish the link to the field objects and then use the "value" property to get the user input for the field.