Blog

Name is Anant Dubey and the intent to create this blog is to discuss the problems and issues that developer face in the dynamics AX development and to share the new things that come up with the new version of AX.

Thursday, March 17, 2022

Enable/ Disable or Hide/ Show new, edit, delete button on form in D365fo

 This is posts shows that how to enable disable or show hide system defined button on Form


FormCommandButtonControl attachButton; public void init() { #SysSystemDefinedButtons

//(This Macro contains all system defined buttons to be used on forms and you can play with

// and you play with all system defined buttons like command button, grid controls etc. super(); attachButton= this.control(this.controlId(#SystemDefinedAttachButton)) as FormCommandButtonControl; attachButton.visible(false); }


  public void init()
    {
        this.form().design().showNewButton(0);
        this.form().design().showDeleteButton(0);
        super();

    }

[ExtensionOf(FormStr(InventBatch))]
public final class P_InventBatchForm_Extension
{
    void run()
    {
        next run();
        inventBatch_ds.allowCreate(false); // Disable System Defined NEW Button
      }

}

ref: - System-defined buttons - Finance & Operations | Dynamics 365 | Microsoft Docs