CurrPage.CLOSE

rocatis
Member Posts: 163
I know there are some other discussions about CurrPage.CLOSE not working in the OnOpenPage trigger but as far as I can figure out it doesn't work anywhere, except on actions. It seems that CurrPage.UPDATE has the same problem which raises the question if any of the CurrPage commands actually work.
My problem stems from the fact that I need to close a page from code without user intervention. In this example the page should close 2 seconds after being opened. If you remove the CurrPage.CLOSE the page should continually show the current time on the page - it doesn't.
The f.CREATEs are a debug tool to convince me that the code is actually running - which it is.
My problem stems from the fact that I need to close a page from code without user intervention. In this example the page should close 2 seconds after being opened. If you remove the CurrPage.CLOSE the page should continually show the current time on the page - it doesn't.
The f.CREATEs are a debug tool to convince me that the code is actually running - which it is.
OBJECT Page 99999 CurrPage.CLOSE { OBJECT-PROPERTIES { } PROPERTIES { Editable=No; PageType=Card; OnOpenPage=BEGIN f.CREATE('c:\started.txt'); f.CLOSE; CREATE(timer); timer.Interval(2000); timer.Enabled(TRUE); END; } CONTROLS { { 1000000002;0;Container; ContainerType=ContentArea } { 1000000001;1;Group ; GroupType=Group } { 1000000003;2;Field ; SourceExpr=TIME } } CODE { VAR timer@1000000004 : Automation "{3B311C81-140E-11D5-8B18-00D0590B4EC5} 1.0:{3B311C92-140E-11D5-8B18-00D0590B4EC5}:'Navision Timer 1.0'.Timer" WITHEVENTS; f@1000000005 : File; PROCEDURE dostuff@1000000000(); BEGIN f.CREATE('c:\ended.txt'); f.CLOSE; CurrPage.UPDATE(FALSE); CurrPage.CLOSE; END; EVENT timer@1000000004::Timer@1(Milliseconds@1000000000 : Integer); BEGIN timer.Enabled(FALSE); dostuff; timer.Enabled(TRUE); END; EVENT timer@1000000004::TimerError@2(ErrorString@1000000000 : Text[1024]); BEGIN END; BEGIN END. } }Any ideas for workarounds??
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup
Senior NAV Developer
Elbek & Vejrup
0
Comments
-
Kinda limited response to that one...
Anyways, I've done some further investigation which has led me to two conclusions:
1) The NavTimer automation does not work on the RTC so don't attempt to use it.
2) A page will not run code unless it has focus.
Seeing as my original problem was to launch a sub process (a page) and have it running independently of the main process (the RTC), the conclusion is that it cannot be done ](*,)
Ideas for workarounds are still welcome - I'm out of ideas.Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
You'll have to write an AddIn and close the Page through .NET - Code.
The AddIn could sit on the Page which you want to close automatically.
In .NET you can access your Page through the Application.OpenForms collection.0 -
rocatis wrote:wakestar wrote:You'll have to write an AddIn and close the Page through .NET - Code.
I don't experience any "non executing code"... no matter wheter the page has focus or not.
The page I created uses a .NET - Timer (based on Freddy's AddIn-Example) and is in the background most of the time.
The timer looks for a specific txt-File every second and is processed in Navision. The page gets activated and is in the foreground whenever the specific file is created.0 -
wakestar wrote:I don't experience any "non executing code"... no matter wheter the page has focus or not.
The page I created uses a .NET - Timer (based on Freddy's AddIn-Example) and is in the background most of the time.
The timer looks for a specific txt-File every second and is processed in Navision. The page gets activated and is in the foreground whenever the specific file is created.Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
I'm not supposed to send you the objects from the solution.
I would suggest to start with Freddy's Timer-AddIn-Example and then ask questions here.
http://blogs.msdn.com/b/freddyk/archive ... -page.aspx0
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