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
SOLVED

transform adobe javascript to aem formcalc

Avatar

Level 1

hello

I have this script 

// Get field values as numbers

    var v1 = +getField("Text2 ").value;

    var v2 = +getField("Text10").value;

    var v3 = +getField("Text12").value;    

      var v4 = +getField("Text11").value;   

// calculate this field value

    event.value = v1+v2+v3 - v4;

how can i transform it to aem FormCalc;

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@klothoskir1 

the value will be in rawValue can be get using fieldname.rawValue

myField1.rawValue + myField2.rawValue + myField3.rawValue

var is supported so you can put it in var

2 Replies

Avatar

Correct answer by
Employee Advisor

@klothoskir1 

the value will be in rawValue can be get using fieldname.rawValue

myField1.rawValue + myField2.rawValue + myField3.rawValue

var is supported so you can put it in var