Starting a function automatically when form opens

ecarmodyecarmody Member Posts: 53
edited 2004-11-07 in Navision Attain
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

Comments

  • fbfb Member Posts: 246
    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
    The first time you can write to the db is in the OnOpenForm trigger...
  • Dean_AxonDean_Axon Member Posts: 193
    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 simple
Sign In or Register to comment.