Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Answered

Remove cancelled PO lines from PO confirmation report

(1) ShareShare
ReportReport
Posted on by 572
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 572 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. 
  • D365  beginner Profile Picture
    D365 beginner 572 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.
     
  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,431 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 572 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 572 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... 291,431 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 3,323 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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans