NAV20090Refresh record count in Factbox/FastTab

rsaritzky
Member Posts: 469
Hi all,
I have a simple list page of sales leads - similar to the Customer List. The Sales Lead table has a flowfield "Comments Exist" - it is a Boolean indicating if there are related records in the associated comment table.
The users wish to do 2 things:
1. Be able to filter on the "Comments Exist" column. In a normal list page, this works OK. Yes I know it's not the best thing to filter on a flowfield, but it works.
2. Display a COUNT of the records being displayed. So if they filter on a date column, or region, or even "Comments Exist", the record count is displayed.
Problem: I have tried putting a field that calculates the COUNT in a fixedLayout group and a FastTab. In both cases, if the user filters on "Comments Exist", the page hangs. Removing the group or Fasttab causes the problem to go away.
So I created a factbox that contains the record count. However, when the list is filtered, I cannot get the factbox to refresh.
The typical way to use a factbox is to have a "SubFormLink" value that links the value of a single record in the calling page to a record or group of records in the factbox. However, in this case, there is no link except the filtered list of records in the main page.
I've tried creating a function in the factbox that calculates the count based on the filtered list, e.g. the function in the factbox page that is called is:
This function is called from the main list page in the OnAfterGetRecord trigger, which is called after a new filter is set on the page.
I have also verified that the filter is passed, and the value of "LeadCount" is correct. However, I cannot get the factbox to "refresh" and display the correct value of "LeadCount".
Does anyone have an idea on how to display this record count and also allow filtering on the flowfield?
I have a simple list page of sales leads - similar to the Customer List. The Sales Lead table has a flowfield "Comments Exist" - it is a Boolean indicating if there are related records in the associated comment table.
The users wish to do 2 things:
1. Be able to filter on the "Comments Exist" column. In a normal list page, this works OK. Yes I know it's not the best thing to filter on a flowfield, but it works.
2. Display a COUNT of the records being displayed. So if they filter on a date column, or region, or even "Comments Exist", the record count is displayed.
Problem: I have tried putting a field that calculates the COUNT in a fixedLayout group and a FastTab. In both cases, if the user filters on "Comments Exist", the page hangs. Removing the group or Fasttab causes the problem to go away.
So I created a factbox that contains the record count. However, when the list is filtered, I cannot get the factbox to refresh.
The typical way to use a factbox is to have a "SubFormLink" value that links the value of a single record in the calling page to a record or group of records in the factbox. However, in this case, there is no link except the filtered list of records in the main page.
I've tried creating a function in the factbox that calculates the count based on the filtered list, e.g. the function in the factbox page that is called is:
Function PassFilter(VAR _leadRecParm : Record "Sales Lead") Rec.COPY(_leadRecParm); LeadCount := COUNT;
This function is called from the main list page in the OnAfterGetRecord trigger, which is called after a new filter is set on the page.
I have also verified that the filter is passed, and the value of "LeadCount" is correct. However, I cannot get the factbox to "refresh" and display the correct value of "LeadCount".
Does anyone have an idea on how to display this record count and also allow filtering on the flowfield?
Ron
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions