Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Level 2

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.

View solution in original post

7 Replies

Avatar

Level 7

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.

Avatar

Level 2

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..

Avatar

Level 1

 

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.

 

Avatar

Correct answer by
Level 2

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.

Avatar

Level 7

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.


Avatar

Level 1

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

Avatar

Level 2

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