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

Adding additional records to report data provider via extension

(0) ShareShare
ReportReport
Posted on by 50

I am working on an issue with the WHSLoadList report, where Open shipments are not showing on the report in the case where work was cancelled. These shipments still end up getting added to loads, but do not show on the report.

I can see in the report data provider why these records are not included (because of the cancelled work status)

while select workLine
    join workTable
    group by workLine.WorkId
        where workLine.ShipmentId    == whsShipmentTable.ShipmentId &&
              workTable.WorkId       == workLine.WorkId             &&
              workTable.WorkStatus   != WHSWorkStatus::Combined		&&
              workTable.WorkStatus   != WHSWorkStatus::Cancelled
{
    if (!prevWorkId || prevWorkId != workLine.WorkId)
    {
        shipFreightPieces  ;
        prevWorkId = workLine.WorkId;
    }
}

My initial though was to create a COC on the processReport() method and then insert the missing shipments to the WHSLoadListTmp table, but when I do this the values do not show. Going through debug I can see that my code is being hit but where it temp tables I am starting to wonder if the data is being inserted into a different instance of the table. For reference, here is my COC (using dummy data just to show it was possible)

public void processReport()
{
    next processReport();

    WHSLoadListTmp whsLoadListTmp;
    whsLoadListTmp.LoadId = '100198651';
    whsLoadListTmp.ShipmentId = '66';
    whsLoadListTmp.ShipmentStop = 5;
    whsLoadListTmp.insert();

}

Is it even possible to do what I am trying to do, or do I need to make a whole new version of the report with it's own data provider and basically copy the base data provider and change the criteria that are causing my shipments to be missing?

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

    Hi,

    In the COC you need to again add the query to get the canacelled status of work load - use the query run to insert into temp table.

    This will make the report to consume more time because of two queries - one will be standard query and other will be you custom query added in COC.

    This will make the report to consume more time to show the output.

    So my suggestion will be considering the performance, you can go with duplicating the report and add your logic for cancelled work load status.

    Thanks,

    Girish S.

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

    Hi, As you mentioned system's condition is to avoid cancelled work and I can see you can't extend 'workIdsForShipmentId' method as it is private method. So, As Girish mentioned best to create a duplicate report and remove cancelled condition from that method.

  • ChosenSilver Profile Picture
    50 on at

    Thanks for the suggestions to both of you. I am going to try that solution and report back if I was successful.

  • ChosenSilver Profile Picture
    50 on at

    Looks like there is an internal class for a flight that is going to prevent me from being able to do this easily

    internal_5F00_class_5F00_error.png

  • GirishS Profile Picture
    27,827 Moderator on at

    You can duplicate the class but that's not recommended approach.

    You need to fix this either using COC or event handler for processReport method.

    Refer to the below blog which might help you.

    https://nuxulu.com/2019-10-10-extend-the-standard-reports-in-dynamics-365-finance-and-operations/

    Thanks,

    Girish S.

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

    I think this internal method should not be issue. Since you don't have to change report design you can extend processReport method using Coc, let standard processReport run first to import all records as per conditions like avoid Cancelled work.

    Duplicate processReport, workIdsForShipmentId and shipmentLocationList methods and after Next statement in processReportNew extension method, call shipmentLocationListNew method instead of shipmentLocationList.

    In shipmentLocationListNew method, replace workIds initialization with below statement

    List workIds = this.workIdsForShipmentIdNew(whsShipmentTable.ShipmentId);

    And in workIdsForShipmentIdNew, replace while select loop conditions with only condition where WorkStatus == Cancelled

    This will ensure that standard records are inserting and you are adding new records on top of it.  

  • ChosenSilver Profile Picture
    50 on at

    Our report design was already duplicated for this one, but it was using the original RDP with a COC extension to add some additional data. I ended up deciding to duplicate the RDP class as well and bring our COC code into this duplicated class, with the correction to the queries that were excluding the cancelled work.

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

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans