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
BedrockMission!

Learn More

View all

Sign in to view all badges

Sum of various row by loop

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

05-09-2019

I have a livecycle dynamic form in which table10 contains Row0, Row1.....Row9

i create a loop for sum of cell4 of table10 rows

var vTotal = 0;

var nRows = SFcsl.Table10.resolveNodes("Row" + i + ".Cell4");

for (var i=0; i<nRows.length; i++)

vTotal = vTotal + nRows.rawValue;

this.rawValue = vTotal;

but it result show always 0

plz help me

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

06-09-2019

Your SOM expression for resolveNodes() is wrong.

Try

var nRows = SFcsl.Table10.resolveNodes("#subform[*]" + ".Cell4"),

   vTotal = 0;

for (var i=0; i<nRows.length; i++) {

    vTotal += nRows.item(i).rawValue;

}

this.rawValue = vTotal;

Answers (10)

Answers (10)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

19-09-2019

Ok, that's no a big deal.

var c = this.caption.value.text.value,

r = "";

switch (c) {

case "Bad" : r = "Good"; break;

case "Good" : r = "Average"; break;

case "Average" : r = "Bad"; break;

default: r = "Good";

}

this.caption.value.text.value = r;

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

19-09-2019

Thank you very much

finally its working.

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

19-09-2019

i want to use a Button instead of Dropdown List

so i can choose a option (good/average/bad) by click a button

after first click  of button "button's caption = Good"

after Second click  of button "button's caption = Average"

after third click of button "button's caption = bad"

plz help

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

19-09-2019

Well, you might explain what you're after. Where do you enter the values "OnClick" etc. and which caption you want to change?

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

18-09-2019

sir its not working in click event of a button plz help?

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

14-09-2019

when i use this script in click event of a button its not working.

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

14-09-2019

Hi,

for this scenario you can use a switch() expression.

var c = this.rawValue, r = "";

switch (c) {

case "OnClick" : r = "Good"; break;

case "On2Click" : r = "Average"; break;

case "offClick" : r = "Bad"; break;

}

this.caption.value.text.value = r;

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

13-09-2019

plz suggest a script to change caption of a button when click

i try this but not working

if (this.rawValue == "OnClick")

{

this.caption.value.text.value = "Good";

}

else if (this.rawValue == "offClick")

{

this.caption.value.text.value = "Bad";

}

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

07-09-2019

You can filter the type of row by using predicates.

var nRows = SFcsl.Table10.resolveNodes('#subform.[assist.role == "TR"]'),

    vTotal = 0;

for (var i=0; i<nRows.length; i++) {

    vTotal += nRows.item(i).Cell4.rawValue;

}

this.rawValue = vTotal;

Avatar

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 2
aka44356106
Level 2

Likes

10 likes

Total Posts

56 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
aka44356106
Level 2

06-09-2019

Thanks a lot for correction in script.

its work perfectly but

this script will not work  if table10 conatins headerRow  with textfield.

i check       for (var i=1; i<nRows.length; i++)

but no result show.