web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Franz Kalchmair Blog / How to display sum value in...

How to display sum value in factbox on base of multiple line selection

keoma Profile Picture keoma 32,729

Typical issue is to show a calculated value in a factbox on base of the currently selected line in a list page or the lines in a subpage. Is it possible to get a calculated value on base of more than one selected line? Let’s check out.

Let’s say we want to display the sum of field “Credit Limit” in the customer list when selecting multiple lines. So first we edit page 9082 “Customer Statistics FactBox”. There we add a global variable SumCredLimit (decimal) to the page, then we add a new line in page with sourceexpr = SumCredLimit.

ccl1.png-750x491

Now we add a new global function SetSumCredLimit.

ccl2.PNG-594x65

Save and close the page. Now we edit page 21 customer list. There we rename page part “Customer Statistics FactBox” to CustStatFbx. That’s needed, so that we can reach the custom functions in page “Customer Statistics FactBox” from page “customer list”.

ccl3.png-750x571

After that edit the page code (F9). Goto trigger OnAfterGetCurrRecord, there add local variable Cust (record|Customer). Add following code to trigger:

ccl4.png-750x291

Save and close the page. Now run the Nav windows client and goto customer list.
The result:

ccl5.png-750x485

You see, the new value in the factbox shows the sum of the Credit Limit values of the 3 selected lines.

cheers


Filed under: c/al, dynamics nav, nav 2013, nav 2015, nav 2016, nav functions Tagged: factbox, multiple line selection, sum

Comments

*This post is locked for comments