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 :
Dynamics 365 Community / Forums / Finance forum / Add button in Sales Or...
Finance forum

Add button in Sales Order form

(0) ShareShare
ReportReport
Posted on by 56

Dear all,

I have one requirement.

In Sales order Form I have to add one button print

Then when user clicked on Print button then it  will catch the current record or selected record and based on it will display something in report

That they will discuss later....

Kindly let me know the steps. How to achieve this.

Thanks!

  • Verified answer
    Martin Dráb Profile Picture
    241,656 Most Valuable Professional on at

    Unfortunately you forgot to explain which part you're struggling with. Adding a button to SalesTable form? Fetching selected records? (It has been discussed here many times.) Using them to filter a report? Building a report?

    We can't help you if you don't explain what you need...

  • Suggested answer
    Sukrut Parab Profile Picture
    71,741 Moderator on at

    If you have done similar thing in AX 2012 then there is no difference except adding button/menitemButton to print your report in extension of salestable form. You are going to set controller class in menuItemButton properties and pass your current record to it .

    community.dynamics.com/.../250090

  • @rp@n Profile Picture
    56 on at

    Thanks Sukrut,

    So, What I will do...

    1. create an extension of the SalesTable form - add a Menu Item button

    2. Create an event handler class for the SalesTable form and write code for onClicked event handler of the button i added.

    3. In Menu Item button properties set

    Object type = Class

    Object name = Controller class

    Need record = Yes

    Is't correct?

    Please give me more she'd on this

    Thanks!

  • Verified answer
    Martin Dráb Profile Picture
    241,656 Most Valuable Professional on at

    No, you shouldn't put any business logic to the form, either to clicked() or the OnClicked event. Use a menu item pointing to a controller class and put the logic to this class. You'll get Args object in main() method, which gives you - among other things - selected records. It has been discussed here many times; search for MultiSelectionHelper.

  • Community Member Profile Picture
    on at

    Pass datasource as SalesTable in menu Item(OutPut menu Item),collect current record with element.args().record() in main method of controller class.

  • Verified answer
    Sukrut Parab Profile Picture
    71,741 Moderator on at

    You don't have to do that in clicked event , as Martin suggested attached controller class to menu item and get your record in controller class.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans