Skip to main content

Notifications

Supply Chain Management forum
Suggested answer

Remove cancelled PO lines from PO confirmation report

Posted on by 556
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.   
  • D365  beginner Profile Picture
    D365 beginner 556 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.
     
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,734 Super User 2024 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
    D365 beginner 556 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. 
     
  • D365  beginner Profile Picture
    D365 beginner 556 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;
        }
     
     
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,734 Super User 2024 Season 2 on at
    Remove cancelled PO lines from PO confirmation report
    Moved the question from the General to the Supply Chain Management forum.
  • Suggested answer
    VaHiX Profile Picture
    VaHiX 2,225 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.
     

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

News and Announcements

Forum Structure Changes Coming Soon!

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,734 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,021 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans