Refreshing FORM at fix interval

sunnyk
Member Posts: 280
Hi guys,
I want o have a form based on Prod Order Line table which get refreshed after a predefined interval. Like, If I have 100 records in the Prod Order Line Table, than when i open this new form it will show the first 25 records, than after that interval it shows me next 25 records and keep goin unless i closes the form. Is it possible to refresh the data in a form.
I want o have a form based on Prod Order Line table which get refreshed after a predefined interval. Like, If I have 100 records in the Prod Order Line Table, than when i open this new form it will show the first 25 records, than after that interval it shows me next 25 records and keep goin unless i closes the form. Is it possible to refresh the data in a form.
0
Comments
-
Is it possible to refresh the data in a form.
Answer:
Yes it's possible.Do you make it right, it works too!0 -
sunnyk wrote:Like, If I have 100 records in the Prod Order Line Table, than when i open this new form it will show the first 25 records, than after that interval it shows me next 25 records..."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Property of form: TImerInterval
Code, triggerOnTimer() update(false)
0 -
Thank you all.0
-
I wrote the Code like below in a function call REFRESHDATA() and calling this function from OnTimer.
ProdOrderLine2.SETRANGE(ProdOrderLine2.Status,ProdOrderLine2.Status::Released); TotalOrders := ProdOrderLine2.COUNT; IF FirstTime THEN BEGIN IF ProdOrderLine.FIND('-') THEN BEGIN gvCount := 0; REPEAT TRANSFERFIELDS(ProdOrderLine); INSERT; gvCount += 1; UNTIL (ProdOrderLine.NEXT = 0) OR (gvCount = 0.25 * TotalOrders) ; FirstTime := FALSE; END; END ELSE BEGIN gvCount := 0; ProdOrderLine.NEXT(-1) ;------/Why? REPEAT TRANSFERFIELDS(ProdOrderLine); INSERT; gvCount += 1; FirstTime := FALSE; UNTIL (ProdOrderLine.NEXT = 0) OR (gvCount = 0.25 * TotalOrders); END; IF ProdOrderLine.NEXT = 0 THEN FirstTime := TRUE;
If i didnt use the line of code ProdOrderLine.NEXT(-1) it is skipping some records. Lets say i have 12 records, The first time it is showing the first 3 records then skip the fourth, than 5-7, skip 8th, thn 9-12 and skip 12th.
And in the onTimer() i wroteDELETEALL; RefreshData; CurrForm.UPDATE(FALSE);
0 -
I personally avoid using timers, especially when they require COUNT or transactions. This would be my last option, only if there is no other way.sunnyk wrote:it is skipping some records
This might be caused byUNTIL (ProdOrderLine.NEXT = 0) OR (gvCount = 0.25 * TotalOrders) ;
because no matter what the result of(gvCount = 0.25 * TotalOrders)
is the NEXT will be executed.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