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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

if then else script help

Avatar

Not applicable
I am trying to have a decimal field called Management that can make the following calculations with two fields ManagerScore and EmployeeScore.



if ManagerScore = null then EmployeeScore *.40

else

(ManagerScore + EmployeeScore) *.40/2



I have tried every possible combination that I can think of in the calculate event using FormCalc or JavaScript and failed every single time. Please help!!!!
2 Replies

Avatar

Not applicable
Mildred try this:



if (ManagerScore.rawValue == null) {

EmployeeScore.rawValue = EmployeeScore.rawValue*0.40;

} else {

EmployeeScore.rawValue = (EmployeeScore.rawValue*0.40)/2;

}