Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Adobe LiveCycle Calculation Help for a Specific Formula

Trex721899
Level 1
Level 1

Hoping to get some help on a calculation I need to input into LiveCycle:

 

Density Core Formula=(100-water-prot-fat-ash)/1.6+prot/1.4+ash/4.5+fat/0.93+water 

 

But unsure what to type into FormCalc to make this work ... 

@LiveCycle

1 Accepted Solution
Kosta_Prokopiu1
Correct answer by
Employee
Employee

It is actually pretty straight forward, using the calculate event I gave you the FormCalc and JavaScript variant. See here and you can open the PDF in Designer to get the script code

 

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:a7fcaf0d-db8c-41db-ba31-bd3e14de1ad...

View solution in original post

3 Replies
Kosta_Prokopiu1
Correct answer by
Employee
Employee

It is actually pretty straight forward, using the calculate event I gave you the FormCalc and JavaScript variant. See here and you can open the PDF in Designer to get the script code

 

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:a7fcaf0d-db8c-41db-ba31-bd3e14de1ad...

View solution in original post

Trex721899
Level 1
Level 1

@Kosta_Prokopiu1  the calculation in my form defaults to 0.62 ... I think something is wrong ... 

Kosta_Prokopiu1
Employee
Employee

mine defaults to 62.5 when all values are 0 - if you don't want that you can surround it with an if statement. I just showed how to bring your formula to FormCalc or JavaScript.

if (water.rawValue <> null or prot.rawValue <> null or fat.rawValue <> null or ash.rawValue <> null) then
  (100-water.rawValue-prot.rawValue-fat.rawValue-ash.rawValue)/1.6+prot.rawValue/1.4+ash.rawValue/4.5+fat.rawValue/0.93+water.rawValue
else
  0
endif