Show number selected

amadman114
Member Posts: 36
Howdy,
I need to find a way to show the users how many rows that have selected in a Navision subform.
What I currently have is this:
However, the textbox on the form only seems to update after the user clicks away from the current selection. I don't understand why this wont work. Any pointers/workarounds?
I need to find a way to show the users how many rows that have selected in a Navision subform.
What I currently have is this:
CurrForm.SETSELECTIONFILTER(GrecStockTake); IF GrecStockTake.FIND('-') THEN GintNumberSelected := GrecStockTake.COUNT; CurrForm.UPDATECONTROLS;
However, the textbox on the form only seems to update after the user clicks away from the current selection. I don't understand why this wont work. Any pointers/workarounds?
0
Comments
-
The reason is that the form is not continually updated.
You might try to use the "TimerInterval"-property to do regular checks (once every half second for example), and when you see a change in quantity, update the form. But keep your COUNTs in variables to avoid too much searching the DB and updating the form.
Update the form ONLY if the COUNT has changed!Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
There are several 'issues' with the code you posted.
- Where is that code located? Where is the control to display the count located? Are both on the subform? Otherwise, how is GintNumberSelected shared between the two or else you'll get a count on the header, not on the line. If the control to display the count is on the subform, use COUNT as SourceExpression and forget about all the rest. (edit: The striked-through comment was bogus as SETSELECTIONFILTER is needed).
- FIND is unnecessary
- CurrForm.UPDATECONTROLS updates the captions only (at least, that is what is specified). You will have to use CurrForm.UPDATE
One interesting alternative way to handle updates based on subform changes is the following post:
Send messages from subform to parent form
Timers sometimes are annoying, especially while debugging.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