Main Region

How to get sum of two columns in another column?
| | 2 answers | 9 views

NA
Posted by Nazeer
Apr 13th, 2017 at 06:24
0

Hi,

How to get sum of two columns in another column in grid. Added a demo grid in my workspace 'FX_WS_2142' and application ID '601'. Need to add basic salary and allowance column values and derive total salary in the grid while creating/updating the record.

Looking forward for the solution. Thanks in advance.

Regards, Nazeer

1 Comment

NA
Nazeer on Apr 13th, 2017 at 08:17

Thank you... It works fine...

Profile Image
Posted by FOEX-SUPPORT
Apr 13th, 2017 at 07:57
0

Thank you for the test case, much appreciated.

We have updated your test case with a working example. To achieve your requirement we need to use the "FOEX Grid Set Column Value on Column Change" action which will update your "total salary" column when the "basic" or "allowance" values change.

You need to setup your actions to listen to the "FOEX Grid - Before Edit" event. e.g.

alt text

alt text

alt text

To explain the javascript expression in use and the variable names "newValue" and "record" they are made available to you which you can see in the help text e.g.

alt text

And here is the result

alt text

0 Comments

NA
Posted by Nazeer
Apr 18th, 2017 at 07:41
0

To get decimal numbers, we need to use parseFloat instead of parseInt like below.

(parseFloat(newValue, 10) + parseFloat(record.get('ALOW_SAL'), 10))

I added this just to help others, what i found when i tried with decimals.

0 Comments

You must log in or sign up to post questions and answers.