13 February 2023

Form control value versioning view Manager and make bold the modified value in Form Control in D365 FO

 x++ code  to set bold of field value  based on the modification in D365FO Form control

Form : PurchVendorPortalResponses

 private void registerForChangeTracking()

    {

        viewManager = VersioningDocumentViewManager::construct();

        viewManager.registerDataContainerForDataSource(PurchaseOrderResponseHeader_DS,

            VersioningDocumentViewDataContainer::constructFromDataSource(

                PurchaseOrderResponseHeader_DS,

                [fieldStr(PurchaseOrderResponseHeaderAllVersions, PurchTableVersion)],

                fieldStr(PurchaseOrderResponseHeaderAllVersions, VersionDateTime),

                new PurchaseOrderResponseHeaderMapper()));

        viewManager.registerDataContainerForDataSource(PurchaseOrderResponseLine_DS,

            VersioningDocumentViewDataContainer::constructFromDataSource(

                PurchaseOrderResponseLine_DS,

                [fieldStr(PurchaseOrderResponseLineAllVersions, PurchTableVersion),

                 fieldStr(PurchaseOrderResponseLineAllVersions, PurchaseOrderResponseLine)],

                fieldStr(PurchaseOrderResponseLineAllVersions, VersionDateTime),

                new PurchaseOrderResponseLineMapper()));

        viewManager.registerControlForTracking(PurchaseOrderResponseHeader_DlvTerm);

        viewManager.registerControlForTracking(PurchaseOrderResponseHeader_DlvMode);

        viewManager.registerControlForTracking(PurchaseOrderResponseHeader_VendorRef);

        viewManager.registerControlForTracking(PurchaseOrderResponseLine_PurchQty);

        viewManager.registerControlForTracking(PurchaseOrderResponseLine_ConfirmedDlv);

        viewManager.registerControlForTracking(PurchaseOrderResponseLine_ExternalItemId);

        viewManager.registerControlForTracking(PurchaseOrderResponseLine_Name);

    }

=====

Extension to add extra feild.

/// <summary>

/// 

/// </summary>

[ExtensionOf(formstr(PurchVendorPortalResponses))]

final class TestPurchVendorPortalResponses_Extension

{

    /// <summary>

    /// 

    /// </summary>

    public void init()

    {

        next init();

        viewManager.registerControlForTracking(PurchaseOrderResponseLine_PurchPrice);

    }

}

====

Similarly:

Form: PurchVendorPortalAllResponse

Method: registerForChangeTracking()

Extenion to add new control for tracking and bold:

[ExtensionOf(formstr(PurchVendorPortalAllResponse))]

final class TestPurchVendorPortalAllResponse_Extension

{

    public void init()

    {

        next init();

        VersioningDocumentViewManager viewManager = this.getViewManager();

        viewManager.registerControlForTracking(PurchaseOrderResponseLineAllVersions_PurchPrice);

    }

}

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...