Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Endif prevents formcalc process

Avatar

Former Community Member

I finally figured out how to remove the syntax errors with endif. The problem is now I have no more errors and those fields no longer calculate.

Example for a loan payment: The field requires other fields to calculate so "endif" was needed. The other fields are zero until I fill the form.

 

 

if(Pmt>0) then Pmt(LoanTotal, Blendrate / 1200, Term * 12) (Taxes + Ins + HOA)endif

Payment calculated perfectly prior to "endif" as follows. (LoanTotal, Blendrate / 1200, Term * 12) (Taxes + Ins + HOA)

Not sure how this can be fixed? The form works great, but I hate all the syntax errors.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 7

the if condition should be something like:

if (LoanTotal > 0 and Blendrate > 0 and Term > 0) then

otherwise you would get a division by 0 error.

View solution in original post

4 Replies

Avatar

Correct answer by
Level 7

the if condition should be something like:

if (LoanTotal > 0 and Blendrate > 0 and Term > 0) then

otherwise you would get a division by 0 error.

Avatar

Former Community Member

Thank you for the help! the code below is what  i've placed in the calulate event in formcalc. It still doesnt work. Is it becuase Ignored the Taxes, ins and HOA?

 

If(Pmt > 0 and Blendrate > 0 and Term > 0) then Pmt(LoanTotal , Blendrate / 1200, Term * 12) + Taxes + Ins + HOA;

endif.

Is there a way to do equal (=) to or greater than(>) also?

Avatar

Former Community Member

I figured out the greater than or equal to thing. Still working on the Pmt.

Thanks again.

Avatar

Former Community Member

Got it working, thank you! Now lets see if if can get the color coded properly.