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

Community site session details

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

How to refresh form automatically while select line in d365fo

(0) ShareShare
ReportReport
Posted on by 630

Dear Friends,

In purchase order form while select line, the form should be refresh automatically.

I am using below code but not working.

[FormDataSourceEventHandler(formDataSourceStr(PurchTable, PurchLine), FormDataSourceEventType::Activated)]
    public static void PurchLine_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
    {
        FormRun          formRun                = sender.formRun();

        FormDataSource   purchline_ds              = formRun.dataSource('PurchLine');//.cursor();

        purchline_ds.refresh();
        purchline_ds.research(true);
       
    }

Thanks and Regards

Rahul

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to refresh form automatically while select line in d365fo

    The nr of attachments changes only when you add/remove attachments. That's the only time when refresh might be needed. You should not refresh every time the user selects a record. Data did not change, therefore refresh is not needed.

    When you select a record, the attachment icon will automatically show the nr of attachments. No refresh needed. But pay attention to the header/lines as Blue Wang suggested.

  • Blue Wang Profile Picture
    on at
    RE: How to refresh form automatically while select line in d365fo

    Hi Rahul.p,

    The attachment function distinguishes the form header and the line.

    When you click on the head , it will become 0.

    The reason for the number change should not be that you clicked refresh.

  • Rahul.p Profile Picture
    630 on at
    RE: How to refresh form automatically while select line in d365fo

    My requirement is, i customized file attachment button and in attachment button i added file while select line it is showing count "0".

    After refresh the form it become count "1"

    So i want place of refresh while selecting line, form should refresh automatically. 

  • Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: How to refresh form automatically while select line in d365fo

    What you are trying to do ? What's your requirement?

  • Rahul.p Profile Picture
    630 on at
    RE: How to refresh form automatically while select line in d365fo

    yes, I used research(true)

    I am using OnActivated event, but it is taking long time to open form.

    Please tell me in which event i have to write logic.

  • Blue Wang Profile Picture
    on at
    RE: How to refresh form automatically while select line in d365fo

    Hi Rahul.p,

    You can use research(true).

    mfmujahidmim.wordpress.com/.../

  • Suggested answer
    Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: How to refresh form automatically while select line in d365fo

    Did you try calling  research ?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,258

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 949 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 631 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans