Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Addition of tag value and a number

Avatar

Level 2

Hi All,

I am facing an issue in adding a tag value with a number with javascript.

I have the following code:

 

var  amount = $record.resolveNode("CONTRACT.AMT_CHECK").value;

 

this.rawValue = Sum(amount, 25);

I am getting the value of "amount" variable, but when i use Sum function its not working.

Can anyone let me know how to add a tag value with a number????

Thanks in advance.....

4 Replies

Avatar

Level 10

The sum function only exists in FormCalc not JavaScript.

Change the language in the script editor to FormCalc.

Avatar

Level 2

Then what is the function is javascript?

Avatar

Level 10

If you are trying to add Integer values in Java Script, try

     this.rawValue = parseInt(amount)+ 25;

Thanks

Srini