Wednesday 2 October 2019

How to hide New and Delete buttons in a form in Dynamics AX/ D365 F&O X++

Below is the simple code I have written in form init() method to hide new and delete button from the user interface.

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

    }




or

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

}

Let me know if you have any questions

@Rahul

2 comments:

  1. Thank you very much for the sharing! COOL..
    szybki kredyt online

    ReplyDelete
  2. If anyone can provide the solution of this thread.

    https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/455311/how-to-hide-system-defined-office-button-systemdefinedofficebutton-from-d365-form

    thanks in advance!

    ReplyDelete

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...