These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to create an IF formula

member
Registered: Aug 24 2010
Posts: 3
Answered

I have been trying to create an IF formula for a form I am creating and I do not know how to do this in LiveCycle.

I have a table that I need to say IF this cell information is greater than the information entered in another cell put (CB), IF it is less leave it blank.

I know the formula to use for an excel document, but everthing that I have tried to create in LiveCycle is giving me an error.

This is how I would assume the equation should go, but it does not work.

form1.#subform[0].Table1.Row1.red1::calculate - (JavaScript, client)
IF(xfa.resolveNode("form1.#subform.Table1.Row1.Cur1")>xfa.resolveNode("form1.#subform.Table1.Row1.Prop1"),"CB"," ")

Can you please let me know what I am not doing correctly

My Product Information:
LiveCycle Designer, Windows
Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

You'll need to use ".rawValue" property to refer to the values in object, and you'll have to code like general javascript formula.

try;

if (xfa.resolveNode("form1.#subform.Table1.Row1.Cur1").rawValue > xfa.resolveNode("form1.#subform.Table1.Row1.Prop1").rawValue){this.rawValue = "CB";}else{this.rawValue = " ";}
member
Registered: Aug 24 2010
Posts: 3
That doesn't quite work.
I now get the CB when I enter a number in the fist box (Curl1), but as soon as you put a number in the 2nd box (Prop1) that is lower than (Curl1) the CB disappears. I need the CB to stay when a number is entered in the (Prop1) box that is lower.
Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

I just made a document with table that has same name and copied the formula.
It actually will works in the way you have been explaining.

Curl1:10 , Prop1:blank , red1:CB
Curl1:10 , Prop1:10 , red1:blank
Curl1:10 , Prop1:9 , red1:CB

Please check the object names that you're refering to, and make sure that you are not updating the red1 value from other scripts.

BTW, if all your obejcts are still in "form1.#subform.Table1.Row1", it can be coded like following and it might be easier to check the links.

if (Cur1.rawValue > Prop1.rawValue){this.rawValue = "CB";}else{this.rawValue = " ";}
member
Registered: Aug 24 2010
Posts: 3
Thank you so much this worked.