General X++ Development

How do I add a button to an existing D365FO form?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I add a button to an existing D365FO form?

SSunny Vasty75 reputation · answered Aug 13, 2026

Create a form extension and add the button through metadata.

The normal flow is:

  1. Create an extension of the form.
  2. Add the button to the correct Action Pane or button group.
  3. Use a menu item if the button launches another object.
  4. If it needs custom click logic, extend the control's clicked() method or use the appropriate event.

If metadata can do the job, use metadata. There is no reason to dynamically create a button in X++ for a normal form customization.