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

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Remove cancelled PO lines from PO confirmation report

(1) ShareShare
ReportReport
Posted on by 618
Hi Experts,
 
I have a requirement that not to show canceled lines in the PO confirmation report. currently it is printing all the lines from the PO. Can anyone help to write COC for PurchPurchaseOrderDP class to add this validation in order to include all lines except canceled. Thanks.   
I have the same question (0)
  • Suggested answer
    Vahid Ghafarpour Profile Picture
    11,993 Super User 2025 Season 2 on at
    Remove cancelled PO lines from PO confirmation report
    You can use Chain of Command (CoC) to extend the PurchPurchaseOrderDP class and add the validation to exclude canceled lines from the PO confirmation report.
     
  • André Arnaud de Calavon Profile Picture
    299,782 Super User 2025 Season 2 on at
    Remove cancelled PO lines from PO confirmation report
    Moved the question from the General to the Supply Chain Management forum.
  • D365  beginner Profile Picture
    618 on at
    Remove cancelled PO lines from PO confirmation report
    Thank you Andre & Vahix for the response, 
     
    Actually I was trying to amend the class PurchPurchaseOrderDP using coc to achieve the same. but it didn't work. 
     
     protected PurchPurchaseOrderTmp initializeOrderLine(
            PurchPurchaseOrderHeader _purchaseOrderHeader,
            boolean _highlightUpdated,
            PurchPurchaseOrderDPOrderLineQuerySelection _orderLineSelection)
        {
            PurchLine purchOrderPurchLine;
            PurchLineAllVersions purchLineAllVersions   = _orderLineSelection.parmPurchLineAllVersions();
            PurchPurchaseOrderTmp purchPurchaseOrderTmp = next initializeOrderLine(
                _purchaseOrderHeader,
                _highlightUpdated,
                _orderLineSelection);
            purchPurchaseOrderTmp.PurchStatus           = purchLineAllVersions.PurchStatus;
            
            if(purchLineAllVersions.PurchStatus != PurchStatus::Canceled)
            {
                purchPurchaseOrderTmp.ItemId = purchLineAllVersions.ItemId;
            }
            return purchPurchaseOrderTmp;
        }
     
     
  • D365  beginner Profile Picture
    618 on at
    Remove cancelled PO lines from PO confirmation report
    I believe we need to extend the class PurchPurchaseOrderDPOrderLineQuery to avoid canceled lines. It would be great if someone can confirm this and shows how to achieve it. 
     
  • Verified answer
    André Arnaud de Calavon Profile Picture
    299,782 Super User 2025 Season 2 on at
    Remove cancelled PO lines from PO confirmation report
    Hi D365 beginner, 
     
    The standard coding will insert all PO lines and the SSRS report is not aware of ranges you set in coding. What you would need to do here is either creating a full new data provider class or in an extension class try to delete several lines from the purchPurchaseOrderTmp table.
  • D365  beginner Profile Picture
    618 on at
    Remove cancelled PO lines from PO confirmation report
    Hi Andre, Thank you for your suggestions. Is there any chance to extend below methods in the DP class to control it.
     
  • D365  beginner Profile Picture
    618 on at
    Remove cancelled PO lines from PO confirmation report
    It worked, Managed to delete the cancelled lines from PurchPurchaseOrderTmp using a class extension as Andre suggested. Thanks a lot. 

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 319

#2
Siv Sagar Profile Picture

Siv Sagar 196 Super User 2025 Season 2

#3
Sagar Suman Profile Picture

Sagar Suman 172 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans