Showing posts with label edit. Show all posts
Showing posts with label edit. Show all posts

Wednesday, November 20, 2019

Operating with system defined buttons in form Action pane

Say, we have to reference Edit button.



For this we use the macro #define.SystemDefinedViewEditButton('SystemDefinedViewEditButton')

The whole list is present in SysSystemDefinedButtons macro


Code snippet for your active method in name_DS

int active()
        {
            
            #SysSystemDefinedButtons
 
            ret = super();
 
         < ... >
            FormCommandButtonControl editButton = element.control(element.controlId(#SystemDefinedViewEditButton)) as FormCommandButtonControl;
            editButton.enabled(name_ds.allowEdit());
 
            return ret;
        }

Check this article https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/system-defined-buttons

Wednesday, June 6, 2018

Extensions and Edit and Display methods declaration in D365

Just a short note for my current PU.

Display methods work well as instance methods from table extensions. As to edit-methods, we still need to declare them as static.


[ExtensionOf(tableStr(ProjProposalJour))]
final class myProjProposalJourTable_ProjInvReport_Extension

 static public server edit myProjInvReportFmtDescWithBr myEditInvReportFormatWithBR(ProjProposalJour _this, boolean _set, PrintMgmtReportFormatDescription  _newReportFormat)
    {
        PrintMgmtReportFormatDescription    newReportFormat = _newReportFormat;
        PrintMgmtReportFormatDescription    reportFormat;

        reportFormat = ProjInvoicePrintMgmt::myGetReportFormatWithBR(_this);
        if (_set)
        {
            if (_this.RecId && newReportFormat && newReportFormat != reportFormat)
            {
                ProjInvoicePrintMgmt::myCreateOrUpdateInvoiceWithBRPrintSettings(_this, PrintMgmtNodeType::ProjProposalJour, newReportFormat);
                reportFormat = newReportFormat;
            }
        }
        return reportFormat;
    }


Do not forget to pass the table buffer as the first argument.

More detail can be found in Vania's article about news in PU11.