Starting a function automatically when form opens

ecarmody
Member Posts: 53
Hello,
I've recently discoved the ability to URL launch a form. What I want to do is have a user function on that form start when I URL activate the form.
Currently, the form has a button that the user clicks which has a call to the function. If I URL launch the form, I'm having issues when trying to call the function directly.
There are controls on the form that I want to self init and self populate. The OnHyperLink event seems to occurr to early and the form fields are not populated yet. So, I've tried using a boolean flag and setting in the OnHyperLink event, then checking the flag in the OnActivate and it true call the function. That works, accept I get the database error something like... "cannot modify database from that event"
I could use the Timer event which means setting a boolean flag in the OnHyperLink and then checking that flag in the Timer event. However, I cannot figure out how to set the timer to zero after the event fires once; I don't want it to keep firing. I can't change TimerInterval property from within the code. Is there a way?
Comments and suggestions appreciated.
Cheers,
Eric
I've recently discoved the ability to URL launch a form. What I want to do is have a user function on that form start when I URL activate the form.
Currently, the form has a button that the user clicks which has a call to the function. If I URL launch the form, I'm having issues when trying to call the function directly.
There are controls on the form that I want to self init and self populate. The OnHyperLink event seems to occurr to early and the form fields are not populated yet. So, I've tried using a boolean flag and setting in the OnHyperLink event, then checking the flag in the OnActivate and it true call the function. That works, accept I get the database error something like... "cannot modify database from that event"
I could use the Timer event which means setting a boolean flag in the OnHyperLink and then checking that flag in the Timer event. However, I cannot figure out how to set the timer to zero after the event fires once; I don't want it to keep firing. I can't change TimerInterval property from within the code. Is there a way?
Comments and suggestions appreciated.
Cheers,
Eric
0
Comments
-
Did you consider the OnOpenForm trigger? When opening a form, the order of the form-level triggers seems to be:
- OnInit
- OnHyperlink
- OnOpenForm
- OnFindRecord
- OnAfterGetRecord
- OnActivateForm
0 -
try looking at "Smart Tags" as an alternative to the URL's. These can be intergrated with other MS apps include the sharepoint technologies.
As for the function I would try on of the triggers that fb suggested. Mainly the onAfterGetRecord.Remember: Keep it simple0
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