Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Help with some calculation fields

Avatar

Former Community Member
I'm trying to add a few calculation fields to a form but don't know how the script should be written.



All my fields are in a form called:

topmostSubform



The first field I need to calculate is a percent field;

name:

Current_Percent1



fields needed for calculation:

Current_Salary1/Current_CIP1



so Current_Percent1=Current_Salary1/Current_CIP1



I tried this on the script editor but it didnt work:

Current_Percent1.=(topmostSubform.Current_Salary1/topmostSubform.Current_CIP1)



can someone help me out?
3 Replies

Avatar

Former Community Member
Your script should be FormCalc...not JavaScript. Does that fix it?

Avatar

Former Community Member
Gretchen is correct, wither use formcalc with your calculation or if you want to use javascript change it to:



Current_Percent1.rawValue = topmostsubform.Current_Salary1.rawValue/topmostSubform.Current_CIP1.rawValue;



either way should work.

Avatar

Former Community Member
Ok, looks like I got it. I did have it as formcalc but it looks like I wrote in too much info.



I got it to work by setting SHOW to *caculate and adding (Current_Salary1/Current_CIP1) only



Looks like I was making it harder than it needed to be.



Thanks