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

Calculations with instanceManager Count

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

19-10-2017

I have a total sum field that takes values from two different subforms. One subform has an initial count of 0.

If users want, they can "add" that subform into view.

So, I imagine I need two if conditions for my calculations. One with only 1 subform and one with 2 subforms.

under calculate event

formCalc

I tried this:

if (RepeatWrap.instanceManager.count == 0 ) then

$.rawValue =  Sum(Table1.Row[*].Cell8);

else

$.rawValue =  Sum(Table1.Row[*].Cell8)+Sum(RepeatWrap[*].Table1.Row[*].Cell8);
endif

RepeatWrap is the second subform.

If course this is not working..

Is it my syntax or my logic? Most likely both... T_T

Many thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

23-10-2017

I've solved my own syntax errors.

the solution for a Logic IF statement in formCalc under Calculate event:

if (RepeatWrap.instanceManager.count eq "0")

then

$.rawValue=sum(Table1.Row[*].Cell8)

else

$.rawValue=sum(Table1.Row[*].Cell8+(RepeatWrap[*].Table1.Row[*].Cell8)

end if

Hope this serves as a good reference.

Answers (0)