web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Auto refreshing the form in X++

(0) ShareShare
ReportReport
Posted on by 117

Hi Experts,

My requirement is to auto refresh a form every 1 min. I have a custom form and I created a new button - Refresh .I have written a code on Button click  for this but getting error.


    [Control("Button")]
    class Refresh
    {
        /// 
        ///
        /// 
        /// 
        public void clicked()
        {
            int msInterval;
            super();
            this.visible(false);
            Refresh.visible(true);

            this.cancelTimeOut(timeOut);

            msInterval = 1 * 60 * 1000; // Refresh every minute

            StockPredictions_CAP_ds.research(true);
            StockPredictions_CAP_ds.findRecord(StockPredictions_CAP_ds.getFirst());

            Object task = this.setTimeOut(identifierstr(this), methodStr(Refresh, clicked), msInterval, false);
    
            Refresh.visible(true);
            
        }
    }

  • Mohit Rampal Profile Picture
    12,573 Moderator on at

    Hi Harish, you didn't mentioned what's the error and on which line are you getting it.

  • HARISH MEHRA Profile Picture
    117 on at

    Hi Rampal,

    Error - ClassDoesNotContainMethod: Control 'Refresh' does not contain a definition for method 'setTimeOut' and no extension method 'setTimeOut' accepting a first argument of type 'Refresh' is found on any extension class.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
  • HARISH MEHRA Profile Picture
    117 on at

    Hi Bharani,

    Getting error on this also.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

     Please check this article and see if it works for you.

    arbistech.com/.../

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at

    First let's make the code error free. I don't understand why you have opened and closed the brackets at line 31 and 34.

    Also you are directly calling like TimeControl.method() but can you show me where did you defined the class object.

    If all the error goes then do a build and check.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 582 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 410 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 185

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans