Override a System Defined Refresh button in D365O

Essentially this post is going to discuss calling custom code while refreshing a form in D365O, however, you can find more information about other system defined buttons and how you can run extra code or suppress them in this article: System-Defined buttons

Firstly the datahelper() method of the formRun framework class can be used to provide services that allow managing the datasources of the form.

How can I add custom code to run when I click refresh?
We are going to use eventing (pre-event handler and post-event handler) to do this:

1. Write your method that you want to call when the refresh button is clicked








2. In the Form.int subscribe using the datahelper().Refreshing event












3. On refresh click you'll see your message

Comments

  1. Did you try to customize a Post Button event handler? I'm new in D365FO, I would like to add my own code after click event finished.

    Thanks in advance.

    ReplyDelete
    Replies
    1. I'm assuming the post button is not a system defined button. You can use a onClick event handler from the Post Button on the form designer and write your code in the event handler

      Delete

Post a Comment

Popular posts from this blog

Printing PDF Attachments in MSDyn365FO