Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Help with script

Avatar

Level 7

What wrong with my script( does not executo on click event):

if (form1.Total_Assessment_Sub.Total_Performance.rawValue==0)

{form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="";

}

else if ( form1.Total_Assessment_Sub.Total_Performance.rawValue >=4.5)

{ form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="OUTSTANDING";

}

else

{if (form1.Total_Assessment_Sub.Total_Performance.rawValue >=3.5&&Total_Behaviours.rawValue<4.5)

{form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="EXCEEDS EXPECTATIONS";

}

else

{if (form1.Total_Assessment_Sub.Total_Performance.rawValue >=2.5&&Total_Behaviours.rawValue<3.5)

{form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="MEETS EXPECTATIONS";

}

else

{ if (form1.Total_Assessment_Sub.Total_Performance.rawValue >=1.5&&Total_Behaviours.rawValue<2.5)

{form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="NEEDS IMPROVEMENT";

}

else

{ if (form1.Total_Assessment_Sub.Total_Performance.rawValue<1.5&&Total_Behaviours.rawValue>0)

{ form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="DOES NOT MEET EXPECTATIONS";

}

                }      

            }

        }

    }  

1 Accepted Solution

Avatar

Correct answer by
Level 5

You start with the wrong code in line 7 with the second else if statement

With this line EVERY else if statment and the curly brackets are wrong. You have some curly brackets too much.

Wrong:

else

{if (form1.Total_Assessment_Sub.Total_Performance.rawValue >=3.5&&Total_Behaviours.rawValue<4.5)

{form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="EXCEEDS EXPECTATIONS";

}

Right:

else if (form1.Total_Assessment_Sub.Total_Performance.rawValue >=3.5&&Total_Behaviours.rawValue<4.5)

{

    form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="EXCEEDS EXPECTATIONS";

}

Kind regards Mandy

View solution in original post

2 Replies

Avatar

Level 4

Hey there,

first thing i see is that  you've got

else { if (...) {}

should be

else if (...) {}

Avatar

Correct answer by
Level 5

You start with the wrong code in line 7 with the second else if statement

With this line EVERY else if statment and the curly brackets are wrong. You have some curly brackets too much.

Wrong:

else

{if (form1.Total_Assessment_Sub.Total_Performance.rawValue >=3.5&&Total_Behaviours.rawValue<4.5)

{form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="EXCEEDS EXPECTATIONS";

}

Right:

else if (form1.Total_Assessment_Sub.Total_Performance.rawValue >=3.5&&Total_Behaviours.rawValue<4.5)

{

    form1.Total_Assessment_Sub.AssessmentValueTotal.rawValue="EXCEEDS EXPECTATIONS";

}

Kind regards Mandy