Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / How can i change Label...
Finance forum
Suggested answer

How can i change Label of existing form label for my menu item

Posted on by 10
I created a custom module in which a menu item is there and i created a CustTable form extension for this menu item and when I click on New button to add a record a dialog box is opening and in that dialog box for 2 fields I want to change their label but when I go in visual studio in form design >action pane >dynamicHeader nothing is there and on the form it is saying that its under dynamicHeader_AccountNum how can I find it and change it label .
  • Deepak Agarwal Profile Picture
    Deepak Agarwal 127 on at
    How can i change Label of existing form label for my menu item
    I guess you are trying to change dialog fields label, which you can do it in your code on contact class, refer below code sample, 
     
     [DataMember,
        SysOperationLabel(literalStr("My Customers label")),
        SysOperationHelpText(literalStr("My Customer help text"))
        ]
        public CustAccount parmSynchCust(CustAccount _custAccount= custAccount)
        {
            custAccount= _custAccount;
            return custAccount;
        }
  • Andre Arnaud de Calavon Profile Picture
    Andre Arnaud de Cal... 283,405 Super User on at
    How can i change Label of existing form label for my menu item
    When you mention that your code is not working, have you already used the debugger to find out if your coding is being executed at all and if it can find the control?
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,495 Super User on at
    How can i change Label of existing form label for my menu item
    This form which you are talking about creates controls on run time. So you need to check at which place most probably init of form. If init is the right method, you can then get the control and change the label from x++. Also as this form is called from multiple places, make sure that you made a check checking the caller so that this doesnt affect other places.

    I'm editing my comment since you added when I might be typing. So as I said you need to identify at which point this control is getting created and there you can do a coc.
  • Community member Profile Picture
    Community member 10 on at
    How can i change Label of existing form label for my menu item
    [ExtensionOf(formStr(DirPartyQuickCreateForm))]
    final class DirPartyQuickCreateForm_TDHospitalityManagement1_Extension
    {
        public void init()
        {
            next init(); 
            MenuItemName callerForm = this.args().menuItemName();
            if (callerForm && strCmp(callerForm, menuItemDisplayStr(TD_AllCustomerMenuItem)) == 0)
            {
                //  DynamicHeader_AccountNum is the technical name of the control
                FormStringControl control = this. design().controlName("DynamicHeader_AccountNum") as FormStringControl;
                if (control)
                {
                    control.label("@TD_LableFile:TDHM0012");
                }
            }
        }
    }

    I used this code but it is not working can someone suggest something else

     
  • Andre Arnaud de Calavon Profile Picture
    Andre Arnaud de Cal... 283,405 Super User on at
    How can i change Label of existing form label for my menu item
    Hi,
     
    You are using the standard creation form for adding customers. This form (DirPartyQuickCreate) is used for multiple entities, as an example also for prospects. 
    The form is built up dynamically when it opens. It will then set the table for a common data source and include several fields from a field group.
     
    I do assume you also have the standard customer form where you need to need the original labels. If you try to follow the logic on initialization of the form you can try to change the runtime label with X++ coding. 
     
     
  • Community member Profile Picture
    Community member 10 on at
    How can i change Label of existing form label for my menu item
    The issue is i can't find the control name anywhere it is not visible in action pane also it s not visible


  • Waed Ayyad Profile Picture
    Waed Ayyad 2,537 on at
    How can i change Label of existing form label for my menu item
    Hi,
     
    Try to search for "dynamicHeader_AccountNum" on the form , then change its label but as you know if you want to change the label on the standard form so you need first to create extension of the form and on the extension change the label of the field.
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Layan Jwei Profile Picture
    Layan Jwei 3,159 Super User on at
    How can i change Label of existing form label for my menu item
    Hi,
     
    Can you please explain what do you mean by "create custable form extension for this menu item"?
     
    Do you mean you created an extension for custable and this menu item points to custtable?
     
    Also please share screenshots of your form in the UI and in VS
  • Martin Dráb Profile Picture
    Martin Dráb 223,370 Super User on at
    How can i change Label of existing form label for my menu item
    Are you saying you want to change the label of the standard field CustTable.AccountNum (and it doesn't have anything to do with your new fields)? Or am I missing something?
     
    Can you show us a screenshot of the dialog form, or share its name?

Helpful resources

Quick Links

Upcoming TechTalk: Copilot Capabilities…

Review the Copilot features that are currently available in Dynamics 365 Finance…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,405 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,370 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans