Skip to main content
Dynamics 365 Community / Forums / Finance forum / Model name best practices
Finance forum
Suggested answer

Model name best practices

editSubscribe (0) ShareShare
ReportReport
Posted on by 90
Hi,

Is it a best practice to name the model as PrefixExtension like this?


Because I know that when we create an extension for an object like SalesTable Form, then it should be like SalesTable.ZZZExtension. So in this case, this name will be filled automatically.
Attachments
  • Andre Arnaud de Calavon Profile Picture
    Andre Arnaud de Cal... 283,176 Super User on at
    Model name best practices
    Hi,
     
    Both options look OK to me. Can you share the exact BP warning you get for the label file? I'm aware that the contents can give a BP warning about label numbers versus descriptive IDs.
  • Community member Profile Picture
    Community member 90 on at
    Model name best practices
    Hi Martain,

    but if do a mix like below, it won't look consistent
    MyCompanyField1  
    CustTable.MyCompany
    CustTable
    MYC_Extension
    MyCompanyClass1

    So I think it should be either one of those options:

    Option1:
    MyCompanyField1  
    CustTable.MyCompany
    CustTable
    MyCompany_Extension
    MyCompanyClass1


    Option2:
    MYCField1  
    CustTable.MYCExtension
    CustTable
    MYC_Extension
    MYCClass1


    Which one would you go with?

    And in both cases my model will be named MyCompany

    Also for label files, it's best practice to not use Prefix as we'll get the legacy BP warning. So my label file is definitely is going to be called MyCompany_en-US
    So does that mean to be consistent with the label file, i should go with option1?

     
  • Martin Dráb Profile Picture
    Martin Dráb 222,727 Super User on at
    Model name best practices
    It's up to you (documentation: Include either the name of the model where the extension element resides or the prefix that the extension is associated with).
  • Community member Profile Picture
    Community member 90 on at
    Model name best practices
    Hi Martin,

    So if I name the model as MyCompany

    Now for forms and tables, the extension would be sth like CustTable.MyCompany

    For new fields, EDTs, method variables..etc. I think name will be MYCField1 and not MyCompanyField1 right?

    But what about classes
    should they be CustTableMYC_Extension or CustTableMyCompany_Extension?



     
  • Martin Dráb Profile Picture
    Martin Dráb 222,727 Super User on at
    Model name best practices
    The documentation does not say that you must use the Extension suffix. Let me quote it: "an extension of the ContactPerson table in the ContosoCustomizations model might be named ContactPerson.ContosoCustomizations".
  • Andre Arnaud de Calavon Profile Picture
    Andre Arnaud de Cal... 283,176 Super User on at
    Model name best practices
    Hi,
     
    As mentioned below, I agree that the model naming should not have an abbreviation as a prefix or suffix. Just name it to describe what the contents are about. In case you might expect similar model names to be used by different parties, then you can include e.g. a vendor name. If the model is e.g. about Commodity trading, then you can describe it as Contoso Commodity trading.
     
    The link to the naming conventions you shared is about the object names in the model. Yes, that is best practice to follow as much as possible.
  • Community member Profile Picture
    Community member 90 on at
    Model name best practices
    Hi Martin and Komi,

    But Microsoft documentation says that it should be sth like WHSExtension.
    https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/naming-guidelines-extensions#naming-extensions
    so shouldn't we follow Microsoft best practices?

    So it seems it's either I name the model as ZZZExtension, or I name it as ZZZ but i each time i create an extension of the table or form, i will need to rename it and the word extension
  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,251 Super User on at
    Model name best practices
    Hello, 
     
    You can just name the model after the company name. That's more than enough. 
     
    GEMS as model name. CustTable extension will be CustTable.GEMS.
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 222,727 Super User on at
    Model name best practices
    I wouldn't do that and because no standard model (AFAIK) does that either, we can safely say that it's not a best practice.
     
    I wouldn't add an Extension suffix to all extensions. In my opinion, it's already clear that it's an extension. Instead of wasting characters with Extension and using just three characters (ZZZ) for identification of the product (or company), utilize the character for a longer name.
     
    For example, if it's a model for customizations for company MyCompany, you can call both the model and extensions MyCompany, instead of something like MYCExtension.

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 222,727 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans