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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

want to refresh the form datasource through job/class

(0) ShareShare
ReportReport
Posted on by 3,945

hi ,
i have written some code to insert data in a table , after that i want to refresh the corresponding form .
Actually the issue i am facing is , that class from which i want to refresh the form is out of scope for the form , other wise we can refresh like this datasource_ds.refresh().
So please suggest .

Thanks 

*This post is locked for comments

I have the same question (0)
  • Hariharans87 Profile Picture
    36 on at

    Please explain that for what scenario you need this functionality.

    Form and job, class are different. If you call the class inside the form, you can use datasource_ds.research() and datasource_ds.refresh().

    Otherwise, you can call the datasource_ds.research() and datasource_ds.refresh() methods in timing basis, you may be use timer functions.

  • Gautam Profile Picture
    3,945 on at

    The scenario is that i get data from outside of ax and i need to insert it in to ax table.I have a class which captures the values and insert it in to the tables. Once the data is inserted i want the respective form to be refreshed from my class.

  • Hariharans87 Profile Picture
    36 on at

    Form to be refreshed means refresh the datasource of the opened form. Is it correct?

    If yes, i think that, we can't call the opened form or refresh the form datasource from outside of the form.

    You can add the refresh button to refresh the updated records or call the refresh functions by using timer functions.

  • Gautam Profile Picture
    3,945 on at

    ya exactly ,i want to refresh the datasource of the opened form

    Thanks for replying  

  • Suggested answer
    Rachit Profile Picture
    4,015 User Group Leader on at

    You will need to use FormDataSource class to refresh the callet form datasource from the class. Check out an example on this blog

    [View:http://axhelper.blogspot.com.au/2012/01/pass-data-source-records-to-class-or.html?m=1]

    Additionally you can also find many examples in standard AX classes.

    Hope this helps.

  • Gautam Profile Picture
    3,945 on at

    Hi Hariharan,

    can you please tell me how to call the refresh functions by using timer functions.

    Thanks

  • Suggested answer
    5400 Profile Picture
    7,162 on at

    Please write a method(yourmethodOnTheForm) in caller form, as DS_executequery()/refresh and call it in class   as

    Object caller = _args.caller();      

    if (caller is FormRun && formHasMethod(caller, identifierStr(yourmethodOnTheForm)))    

    {        

    caller.yourmethodOnTheForm();    

    }

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    seems you have a form which is open always and you want to refresh it. am I correct to understand?

  • Gautam Profile Picture
    3,945 on at

    ya exactly Sohaib .

    Thanks

  • Verified answer
    Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    you can see two examples

    1) Refresh Form Automatically After Specific Time Interval

    2) AOT\Forms\SystemDate

    AR1.png

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 Launch!

Jump in, show your community spirit, and win prizes!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dserp Profile Picture

dserp 4

#2
dekion Profile Picture

dekion 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans