web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Dynamically Update of Field's display name in Dynamics CRM

(0) ShareShare
ReportReport
Posted on by 82

Hi All,

Is there way to update field' s display dynamically every year.

E.g., Lets say, I have four fields as below:

Predicted Revenue 2023
Predicted Revenue 2024
Predicted Revenue 2025
Predicted Revenue 2026

on first or January 2024, the display name of Predicted Revenue field for 2023 is updated as Predicted Revenue 2024.So, we would have:

Predicted Revenue 2024
Predicted Revenue 2025
Predicted Revenue 2026
Predicted Revenue 2027

All Solutions are welcome!

Regards,

JK

I have the same question (0)
  • Suggested answer
    Ray Profile Picture
    1,537 on at

    Hi,

    Based on your requirement, there are two things need to do, first update the display text on Form, second update the display text on View.

    None-code way: Export the translate and change the display on form and view and then import the translate, this action needs to be done every year.

    Code way: 1. Write a schedule job to update the field metadata (DisplayName), this job runs every year. 2. Write some JS for the form OnLoad event and change the field display (Not sure if there is a code way to export translate and import translate).

  • Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Persis,

    Change the Display Name on the form with formContext.getControl(arg).setLabel(label);. &  new Date();. Use form onload event.

    Change the Display Name of the column by updating the metadata every year with recurrence Power Automate. It will impact views and e.t.c

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Moderator on at

    Hello,

    You can do it by changing the Display name or by changing Label of that field. 

    If you want to limit Name change on form level then only change label of that field on that specific form.

    if you want name change on system level then you will have to update display name of the field. so updated name will be visible on other component like views, forms, etc. 

    Thank you,

    Amit Katariya

  • Persis Profile Picture
    82 on at

    Thanks for the response,

    I am planning to do through Code way, can you please provide any details on how to do steps 1& 2, any links guiding to that also will help me as I am new to CRM development.

    We will not have problems for other languages as we are keeping fields name like Predicted Revenue [CY], Predicted Revenue [CY+1] & so on.

    Regards,

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hi Persis,

    you can dynamically update the display name of a field by using JavaScript and the formContext object. The formContext  object allows you to interact with the forms, controls, and data in Dynamics 365 CRM.

    Here's an example of how you can use JavaScript to dynamically update the display name of a field:

    // Get the attribute
    var attr = formContext.getAttribute("fieldname");
    
    // Update the display name
    attr.setLabel("New Display Name");
    


    You can use this approach in different scenarios such as updating the field name based on the user's language preference, or depending on some other condition like user's role or organization.

    Additionally, you can use this approach to update the display name of fields that are part of a custom control, you can use the getControl method of the formContext object to access the custom control and update the label.


    var customControl = formContext.getControl("controlname");
    customControl.getLabel().setValue("New Display Name");
    


    Keep in mind that, these changes are only visual and do not affect the actual field name or internal behavior, also depending on the form's personalization or customization these changes could be override. It is important to test your changes in a test environment before applying them to a production environment.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 214 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 76

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans