Change form properties in code

nismo2006nismo2006 Member Posts: 22
Hi all,

I have a question that I can't seem to find a solution to but maybe easy.

I am trying to change a forms properties in code. In particular, the time interval for the form.

The user can define, in seconds, the interval time on a setup form and when the main form is run, it must look to that field to define the main forms interval seconds.

I looked into the properties and controls of the CurrForm but it doesn't give the ability to change this property.

Thanks in advance.

](*,)

Comments

  • SavatageSavatage Member Posts: 7,142
    Do you want to put something on the OnTimer Trigger?
    When you open a form for which you have specified a TimerInterval value, the system executes the OnOpenForm trigger. A timer then starts to count the TimerInterval in milliseconds. Once the specified interval has elapsed, the system will execute the OnTimer trigger. The timer then resets to zero and the system repeats the process until you close the form.

    Maybe if you explain a bit on what you are trying to do - it will clearer to us.
    If the C/AL code you enter into the OnTimer trigger makes large demands on system resources, this will have an adverse effect on the performance of the system.
  • nismo2006nismo2006 Member Posts: 22
    Sorry, I will try to clear it up a bit.

    I have code in the OnTimer trigger already that is run every 15 seconds.
    This is defined in the Form - Properties - Timer Interval.

    What needs to happen is on the OnOpen event of the form, it will look into another table (Sales and Receivable Setup - Timer Interval [New Field]) and get the amount of time the user defines (Like 20000 or 30000 milliseconds).

    Then code will redefine the Timer Interval amount from 15000 to the user defined amount. I hope this makes it a little better to understand and I don't even know if this is possible but I appreciate the help.
  • nismo2006nismo2006 Member Posts: 22
    Thanks for the help, I will give it a try.
  • Revolution1210Revolution1210 Member Posts: 161
    Example using the Navision Timer automation controller. Interval can be set programatically at runtime, unlike the event on a form:

    http://www.mibuso.com/forum/viewtopic.php?t=21196&highlight=
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
  • nismo2006nismo2006 Member Posts: 22
    The suggestions worked great, I really appreciate the help! =D>
Sign In or Register to comment.