valvore92
valvore92

Reputation: 317

How to remove title fields in form design caption in Dynamics AX?

I open form with menuitembutton and in caption are visible title fields from datasource. Can I remove it? This form should be for creating new records and this title fields can be confusing.

In my case title bar is not replaced with text "New record". But I insert in run() method line Table_ds.create() and change in menuitem properties EnumTypeParameter, EnumParameter to value "FormOpenMode"

Upvotes: 1

Views: 2753

Answers (2)

Alex Kwitny
Alex Kwitny

Reputation: 11544

Some additional methods. You can change the caption a couple of ways.

Override the form's init method and this will work, but still leaves the (TitleField1, TitleField2) at the end of the caption.

public void init()
{
    super();

    element.design().caption("New Caption");
}

Alternatively, override the form's run() method and do something like this:

public void run()
{
    super();

    WinAPI::setWindowText(this.hWnd(), "New Caption without other stuff");
}

Upvotes: 4

FH-Inway
FH-Inway

Reputation: 5107

The title fields can be removed from the form title bar by clearing the TitleDatasource property of the form's design node.

Note that when a new record is created, the title fields in the form title bar will be replaced with the text "New record".

Upvotes: 3

Related Questions