cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JasonF
Helper III
Helper III

Sum a Gallery in Powers to set the Default value in a form

Not sure what I am doing wrong here and the error not making sense. I have a Detail Form and Gallery of records related to it by setting the Items of the Gallery to the form. So I was thinking it would be easy to set the value of field (on the form) from the gallery. Specifically sum the total of the gallery and update the "Total Sales" field of the form. My intent was to set the default value of the field to 'Sum(Gallery3.AllItems,Amount)". Make sense right?? But NO. For some reason I am getting a "Rule creates a circular reference between properties"... How? ... Why?

 

Anyway, any help would be appreciated or a workaround would be great.

Here is a screen shot for reference:

Sum1.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
JasonF
Helper III
Helper III

I answered my own question. Although I still not understand the circular reference a workaround can be achieved by Setting a variable and assigning that variable to the default.

On posting a detail record:

SubmitForm(Form4); Set(TotalSales,Sum(Gallery3.AllItems,Amount))

And setting the default on the Form for 'Sales Total' :

TotalSales

View solution in original post

1 REPLY 1
JasonF
Helper III
Helper III

I answered my own question. Although I still not understand the circular reference a workaround can be achieved by Setting a variable and assigning that variable to the default.

On posting a detail record:

SubmitForm(Form4); Set(TotalSales,Sum(Gallery3.AllItems,Amount))

And setting the default on the Form for 'Sales Total' :

TotalSales

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (65,134)