Search code examples
fieldaxaptatitlecaption

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"


Solution

  • 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");
    }