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

How to modify Report Parameters button in Store transactions form

(0) ShareShare
ReportReport
Posted on by 309

Hi guys,

In module Retail and commerce > Inquiry, there is a Form that called Store Transaction, and inside the form there is 1 button to set Report Parameter ->

pastedimage1671008123320v1.png

Inside this parameter form, there is date input parameter which is upon tracing, I found that its value (FromDate) is harcoded with today's date minus 7 ->

pastedimage1671008247071v2.png

My issues is I'm plan to modify this "hardcoded", either to make it minus a month before today or might as well make it empty. But I'm having doubts on what is the best way to do this customization.

One important thing, for the form Store Transactions it self, I had extend it, but for the Report Parameter it self, I only want to make the customization effected to my form extension only, will that be possible ? 

How to make the customization know that it is called from a form that it is extended ?

I managed so far to track where the button put in the form, and as below picture, this is set using button, but it has click() method inside which I don't know what it is.

pastedimage1671008915923v3.png

Can we know what is written inside this method ?

But the point is how is the best way to make the "FromDate" in class RetailReportParameters > method new(), to be changed as we want, but only in certain condition for example based on the caller like certain menu item display ?

Thanks,

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    You need to open the RetailTransactionTable form to see the code in the clicked method. On clicked method of "Report parameter form" control they are calling the other form by passing parm object as RetailReportParameter class. Also, RetailsReportParameter is initialized in the RetailTransactionTable form itself.

    So, if you want to change the from date to custom value you can write COC for clicked method of report parameter form - Get the object for RetailReportParameter class and set the parmDateFrom to your custom value.

    How to make the customization know that it is called from a form that it is extended? - Normally if you add extension to standard form, it will merge your customization with standard and show in the form. I don't think you need to check whether it's called from extension form. Also, it's not necessary.

    Thanks,

    Girish S.

  • Axel Cage Profile Picture
    309 on at

    Hi Girish,

    Thank you. At first I thought this code cannot be seen as I saw the font color is dimmed and there is no menu to View Code. But after a while, found out the View Code is by right click the original form from AOT then we will see the whole code.

    My question now is how the CoC will be ? as normally I did CoC on the particular method, but for this customization, how to direct it to tell that the Clicked() method that we want to modify is the one under control EditParameterButton

    pastedimage1671157338481v1.png

    Thanks,

  • GirishS Profile Picture
    27,827 Moderator on at

    FromDate is added as range in RetailTransactionTable and in RetailReportParameterSlider form they have set the value to date control based on the object RetailReportParameters class which is passed from RetailTransactionTable .

    So, do you want to change the value of from date assigned to the control in RetailReportParameterSlider  form?

    Thanks,

    Girish S.

  • Axel Cage Profile Picture
    309 on at

    Hi Girish,

    Yes, I believe so, but the problem is this form (Store transactions) is used by several processes which because of that I need the customization only effected based on specific condition, for example I used to differentiate what I want to display for its data by looking at what MenuItem it is calling.

    So like wise, the FromDate in RetailReportParameters class should look into some condition first before it is run. This is the part I'm still not sure since the button is called within form RetailTransactionTable which is at this level is the one know which menu item calling. Can we upon calling RetailReportParameters class pass some argument first so when it is called it will know who's calling.

    Hope I can clearly described it.

  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Yes, I understood your scenario. One more issue will be since RetailReportParameter is declared globally, so you cannot access this in the clicked method of the COC.

    You cannot add the logic in RetailReportParameter class based on the menu item.

    As a workAround you can write COC for the "RetailReportParameterSlider" form.

    On that form based on the caller menu item you can set the FromDateValue to your custom value in the init method.

    [ExtensionOf(formStr(RetailReportParameterSlider))]
    public final class Test_Extension
    {
        public void init()
        {
            next init();
            if(this.args().menuitemName() == menuItemDisplayStr(RetailTransactionTableMenuItem))
            {
                FromDate.dateValue(today() - 1);
            }
        }
    
    }

    Thanks,

    Girish S.

  • Axel Cage Profile Picture
    309 on at

    Hi Girish,

    But if we put CoC on RetailReportParameterSlider form, does it mean the caller is the RetailTransactionTable form ?

    Although this RetailTransactionTable form is called by my custom menu item, does it acknowledge by RetailReportParameterSlider form, which is another button inside (button Report parameter, as in my picture from 1st thread, which is a standard menu item).

    Thanks,

  • GirishS Profile Picture
    27,827 Moderator on at

    In that case you need to mention the custom menu item button which calls the RetailTransactionTable form.

    Thanks,

    Girish S.

  • Axel Cage Profile Picture
    309 on at

    Yes, I tried this, but as expected, it will then return the menu item of the button "Report Parameters". 

    Because my custom menu item is only calling RetailTransactionTable form, but the "Report Parameter" button inside it, is called by its own original menu item in that button setting.

    pastedimage1671503321629v1.png

    I wonder if I can make use and specify the Parm value, so it looks like I still need to create another CoC on the RetailTransactionTable Form it self, but I don't know how.

    Thanks 

  • GirishS Profile Picture
    27,827 Moderator on at

    Can you tell me one thing - Form where this report parameter form is called? I mean inside the form or from separate menu.

    Thanks,

    Girish S.

  • Axel Cage Profile Picture
    309 on at

    Hi Girish,

    In summary, is this one:

    1. I create new menu item display, lets call it (MNU_RetailTransaction), set to call RetailTransactionTable form

    2. Inside this form there is existing button "Report parameters" on top panel. 

    3. As per my trace this button will call another form RetailReportParameterSlider, On this part I didn't change anything, which make the menu item calls this form is the existing menu item named "RetailReportParameterSlider" based on this code : 

    pastedimage1671509403555v1.png

    4. As per your help, we already create CoC on form RetailReportParameterSlider, but the main issue is, how this form will know that, when this form it self called by the existing menu item (named "RetailReportParameterSlider") which is inside Form RetailTransactionTable, Form RetailTransactionTable was called by my custom menu item "MNU_RetailTransaction"

    Sorry for the confusion.

    Thanks,

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 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans