Tuesday, February 11, 2020

D365FO Edit method in table extension

[ExtensionOf(tableStr(CustInvoiceJour))]
final class CustInvoiceJour_Extension
{
    [SysClientCacheDataMethod]
    public static edit InvoiceDescription invoiceDescription(CustInvoiceJour _this,boolean _update,InvoiceDescription _invoiceDescription)
    {
        CustInvoiceJour             _custInvoiceJour;

        _custInvoiceJour = CustInvoiceJour::findRecId(_this.RecId, _update);

        if (_update)
        {
            ttsbegin;

            _custInvoiceJour.InvoiceDescription = _invoiceDescription;
            _custInvoiceJour.update();

            ttscommit;
        }
       
        return _custInvoiceJour.InvoiceDescription;
    }

}

No comments:

Post a Comment