Wednesday, 30 March 2022

PO Confirmation report in D365 F&O

 /// <summary>

/// This class is a COC of PrintMgmtDocType

/// </summary>

class XDDPrintMgtDocTypeHandlersExt 

{

    /// <summary>

    /// This method is an extension of EventHandlerResult

    /// </summary>

    /// <param name = "_docType">PrintMgmtDocumentType</param>

    /// <param name = "_result">EventHandlerResult</param>

    [SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]

    public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)

    {

        switch (_docType)

        {

            case PrintMgmtDocumentType::PurchaseOrderRequisition:

                _result.result(ssrsReportStr(XDDPurchPurchaseOrder, Report));

                break;

        }

    }

}

1. Duplicate the report and design accordingly.

2. Changes design from Form Notes

http://axhelper.blogspot.com/2020/03/how-to-extend-standard-report-purchase.html


/// <summary>

/// This class is used extension of PurchPurchaseOrderDP

/// </summary>

[ExtensionOf(classStr(PurchPurchaseOrderDP))]

public final class XDDPurchPurchaseOrderDP_Extension

{

    

    protected PurchPurchaseOrderTmp initializeOrderLine(

        PurchPurchaseOrderHeader _purchaseOrderHeader,

        boolean _highlightUpdated,

        PurchPurchaseOrderDPOrderLineQuerySelection _orderLineSelection)

    {

       PurchPurchaseOrderTmp purchPurchaseOrderTmp = next initializeOrderLine(

            _purchaseOrderHeader,

            _highlightUpdated,

            _orderLineSelection);

        

        PurchTable      purchtable  = PurchTable::find(_purchaseOrderHeader.purchid);

        VendTable       vendtable   = VendTable::find(purchtable.OrderAccount);

        vendParameters  vendParameters = vendParameters::find();

        companyInfo     companyInfo    = companyInfo::find();


        PurchLineAllVersions    purchLineAllVersions = _orderLineSelection.parmPurchLineAllVersions();

        PurchLine               purchLine = PurchLine::findInventTransId(purchLineAllVersions.InventTransId);


        purchPurchaseOrderTmp.XDDPurchOrderDate        = DateTimeUtil::date(purchtable.CreatedDateTime);

        purchPurchaseOrderTmp.XDDOrderAccount          = purchtable.OrderAccount + #emptyValue + DirPartyTable::findRec(VendTable.Party).KnownAs;

        purchPurchaseOrderTmp.XDDPurchName             = purchtable.PurchName;

    }

}

No comments:

Post a Comment

DefaultDimension in d365 FO X++

 Navigate to PurchTable methods you can find with DefaultDimension this.DefaultDimension = this.mergeDimension(this.getDefaultDimension(),th...