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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Any reason why every Text string should be a Label ?

(0) ShareShare
ReportReport
Posted on by

Hi guys,

Just some curiosity on what is the reason that every text string should registered as Label and we must use label Id after ? One of "likely" reason I'm guessing is language translation, but we're mostly (or especially in all my projects so far) are built in English which is an international language, and clients are won't mind on that. (except probably clients that not using Latin word "abcde….")

For example like in Controller class, I have these kind of code :

public ClassDescription caption()

{

return "Internal posting profile batch";

}

OR

public static void main(Args args)

{

            MyController MyController;

            MyController= new MyController();

            MyController.parmDialogCaption("Internal posting profile batch job");

                        MyController.startOperation();

}

Those line / text string has warning of BPRule: BPErrorLabelIsText….is not a label ID. I have many like this, but then again why ? I don't want to create label only for this. Is just a single class description and a dialog caption, I will not reuse it somewhere else because this batch job obviously is a single purpose.

Any reason why this is a matter ?

Thanks,

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    Yes, localization is the reason. If I was you, I would still use labels, despite the fact that you would use an English label file only.

    Even if you use English these days, maybe one of your clients will expand to non-English speaking countries and they'll require localization. Vast majority of the world population does not speak English.

    Or you'll want to create a proper ISV solution from your implementation and you'll have to follow best practices. Or you'll want to use different dialects of English (e.g. British vs American English).

  • Community Member Profile Picture
    on at

    Hi Martin,

    So obviously localization is the only reason then. Somewhat agree with non-English speaking countries, although still it is "maybe" one of my clients complaint that. and maybe it is great for ISV, but for non-ISV not too much of matters.

    and if you are saying dialects, then it will bursting to a bigger problem, but I also then think that this language is help in the next platform such as the reporting side in Power BI. They do have Q&A feature that rely on how the language (word) provided. But then again, it is "if" we will using Power BI or such.

    So I still do think it is un-necessary to make it as Warning in F&O apps. If for example we want to skip the checking for Label only, can we do that ?

    Thanks,

  • Suggested answer
    Faisal Fareed Profile Picture
    10,796 User Group Leader on at

    Let's say you have used the text "Sales tax code does not exist." in multiple places in the code for any custom validation. Later your client wants this to change to "Sales tax id does not exist" in all places of the code. You will have to search in all places in AOT where the tax has been used and changed everywhere.

    Now, if you could have used label for the text and have referenced the label id instead hardcoded text then you would only need to update the label description in the label file and that's it.

    you ended up changing one object (label file) and only need to check-in one object.

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    To disable best practice checks, go to Dynamics 365 > Options, then Best Practices, choose your model from the drop-down and uncheck rules that you're not interested in.

    I would still use labels, though.

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    Another advantage of labels is that they're included in references.

    For example, you need to find an error message or a field by name. You find the label (Dynamics 365 > Find labels), right-click it and choose "Find References", which will show you where the label is used. You don't have to search all source files to find the text.

  • Community Member Profile Picture
    on at

    Ok, thanks.

    It is somewhat "Catch-22" thing for me. But I guess I will still activate this check. Although currently I have 6768 BP warning whereby 6000 of it, is Labels, nearly 90%.

    @Faisal, yes I do understand this, the problem is like in my example, it is classes description and dialog caption which actually to describe what the classes is but in front-end. System admins will use those, or even the developers will use those and I haven't seen any IT related worker who doesn't understand English.

    But at least I know the reason now.

    Thanks.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans