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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Modify method edit of the grid (CheckBox) in a form Dynamics 365 F&O

(0) ShareShare
ReportReport
Posted on by 65

Hi Every One

I`m working in dynamics 365 F&O and i need modify a method edit display of the grid in a form. How to edit this methods or how can i add code before or after of the executed this method. i need calculate the sum of amounts of the records have been marked.

if you wnat to know what is the form ? it is PurchJournalSelect_PackingSlip and the method belongs to the datasource VendPakingSlipJour and is named Included (edit display)

Thanks all

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    I recommend that you try to use Chain of Command in Classes\SalesPurchJournalSelect\included . 

    Based on the parameters (_common) you can determine where the call is coming from and you can run your logic before/after that method.

    Are you familiar with Chain of Command in general? If not, please start by typing "dynamics 365 operations Chain of Command" in your favourite web search engine.

  • Lucho2202 Profile Picture
    65 on at

    is a good idea but i´m thinking that this class and this method can be used in other process ? So is better do the customize directly in the form and in this way i´m sure that my code is only evaluated and run in the procees that i need?

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can use Cross references (right click - View references) to see all places where this method is called from.

    And as mentioned, you should make sure that you always check that _common is VendPackingSlipJour before running your logic.

    You can try to implement this also directly on the form but I'm not sure if Chain of Command works with methods of form data sources. It can be used in framework methods of form data sources and form controls, but I'm not sure if it works (yet) with new methods that were developed on the data source. I suggest you try and let us know the result!

    Your Chain of Command class should look something like this (just typing out of my head, no guarantees):

    [ExtensionOf(FormDataSourceStr(PurchJournalSelect_PackingSlip, VendPackingSlipJour)]
    final class MyPurchJournalSelect_PackingSlipForm_VendPackingSlipJourDS_Extension
    {
            edit NoYes included(boolean set,
                                VendPackingSlipJour _vendPackingSlipJour,
                                NoYes _included)
    
            {
            // Add your code here if you want to run it before the standard code
                NoYes ret = next included(set, _vendPackingSlipJour, _included);
                // Add your code here if you want to run it after the standard code
                return ret;
              
            }
    }

  • Suggested answer
    Lucho2202 Profile Picture
    65 on at

    Thanks Nikolaos this solution is good, this code has been functioned correclty and only i´ve had to change the DataSource "VendPackingSlipJourAll".

    Thanks again a have a nice day

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans