문제

I am facing some problem regarding running an object , can be form,report etc, automatically depending on the user defined time. Let us say at 6am everyday, a process report should run automatically.

How can i achieve this?

도움이 되었습니까?

해결책

I have found a Solution for me.. This example runs at 7:40, 12:40 and 16:40 each day.

  1. Using the Navision Timer 1.0 NAVTimer Automation 'Navision Timer 1.0'.Timer

  2. Set the Property 'WithEvents' of the NAVTimer to Yes

    Set the Property 'SingleInstance' of the Codeunit, if you using one, to Yes

  3. In the On Run Trigger write

IF ISCLEAR(NAVTimer) THEN CREATE(NAVTimer);

NAVTimer.Interval := 1 * 60000;  // Important! set to 1 Minute     

NAVTimer.Enabled := TRUE;

In the Timer Trigger (it appers after you change WithEvents Property to Yes) write

sTime := COPYSTR(FORMAT(TIME), 1, 5); // Cut seconds
sHour := COPYSTR(sTime, 1, 2);
sMinute := COPYSTR(sTime, 4, 2);
IF sHour IN ['07','12','16'] THEN
  IF sMinute = '40' THEN
    IF NOT CODEUNIT.RUN(CODEUNIT::xxx) THEN;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top