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

Customise standard sales confirmation report

(0) ShareShare
ReportReport
Posted on by 58

Hi,

I need to add a custom field in the sales confirmation report.

I found many reference but those are not working for my case,

If you have any idea or reference let me know.

thanks and regards,

Aathil Ameen P

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

    Hi Aatthil,

    You need to create new report design - Extend the temp table and add the new fields - Write OnInsertingEvent handler for temp table to populate values to the custom field.

    Can you tell us what issue you got when doing the above steps?

    Thanks,

    Girish S.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at

    First duplicate menuitem giving your new controller class.

    Add the same code in controller like standard but call your new report because extension is not possible for report. We need to duplicate the standard report

    Once duplicated change the name, add your new field (prior add that in the temp table extension). For writing code to populate you can do a coc on process report or can use oninserting event handler of that table.

    Deploy reports and do a build sync.

  • Verified answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, Please check this article and let us know in which step you are facing issue.

    nuxulu.com/.../

  • AXDynamics365 Profile Picture
    58 on at

    " Cannot edit a record in Show confirmation (SalesConfirmHeaderTmp). The operation cannot be completed, since the record was not selected for update. Remember TTSBEGIN/TTSCOMMIT as well as the FORUPDATE clause. "

    getting this error while generating report

  • GirishS Profile Picture
    27,827 Moderator on at

    Maybe you missed to add forUpdate keyword in the select statement.

    Thanks,

    Girish S.

  • AXDynamics365 Profile Picture
    58 on at

    class AatSalesConfirmController_Form_Handler

    {

       /// <summary>

       /// post handler for the process report

    /// method in Sales confirm dp class

       /// </summary>

       /// <param name="args"></param>

       [PostHandlerFor(classStr(SalesConfirmDP), methodStr(SalesConfirmDP, processReport))]

       public static void SalesConfirmDP_Post_processReport(XppPrePostArgs args)

       {

           SalesConfirmDP dpInstance = args.getThis() as SalesConfirmDP;

           SalesConfirmHeaderTmp salesConfirmHeaderTmp = dpInstance.getSalesConfirmHeaderTmp();

           SalesTable salesTable;

    ttsbegin;

           while select forUpdate salesConfirmHeaderTmp

           {

    select * from salesConfirmHeaderTmp

                   where salesConfirmHeaderTmp.CustomerAccount == salesTable.CustomerAccount;

               salesConfirmHeaderTmp.CustomerAccount = salesTable.CustomerAccount;

               salesConfirmHeaderTmp.update();

           }

           ttscommit;

       }

    }

    code for your reference

  • GirishS Profile Picture
    27,827 Moderator on at

    Why do you need one more select statement inside the while statement.

    While select statement is enough for your scenario. No need of select statement inside while select.

    Thanks,

    Girish S.

  • AXDynamics365 Profile Picture
    58 on at

    Thanks bro it worked and report generated.

    but I didn't get my values " salesConfirmHeaderTmp.CustomerAccount = salesTable.CustomerAccount; "

    this is what i saw from an reference but i dont know why it doesnt came for me

  • GirishS Profile Picture
    27,827 Moderator on at

    You decalred SalesTable buffer but where will you get cust account?

    Thanks,

    Girish S.

  • AXDynamics365 Profile Picture
    58 on at

    customer account is mu custom field

    those values are come from SalesOder form , in that sales order form I used this customer Account where its data source is salesTable thats why i mapped like this "salesConfirmHeaderTmp.CustomerAccount = salesTable.CustomerAccount"

    but i dont know how i get that field value

    if you have any idea let me know

    Thanks in advance Girish S

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

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 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