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

If statement

Avatar

Level 2

Please have mercy on me and my headache!

I'm tripping over my own feet at this point.  All I'm trying to do is a simple if..then..else function and getting no where.  Here's what I've put in:

if(ProjectedADC>RehabBeds)then((RehabBeds-ADC)*400000)else((ProjectedADC-ADC)*400000)

I've checked and I have FormCalc selected as the language, and the individual statements function without the if..then..else, but when I put them together, nada.

This problem is probably staring me right in the face.  The error I get when trying to preview the form is:

Script failed (language is formcalc; context is

xfa[0].form[0].ExistingRevenueOpp[0].#subform[0].ExistingRevenueOpp[0])

script=if(ProjectedADC>RehabBeds)then((RehabBeds-ADC)*400000)else((Pr

ojectedADC-ADC)*400000)

Error: syntax error near token ')' on line 4, column 0.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You need an 'endif' at the end.

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

You need an 'endif' at the end.

Avatar

Level 2

Never mind.  Danged Endif was missing.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----