al-code-outline icon indicating copy to clipboard operation
al-code-outline copied to clipboard

Wizard: first set the name of the reference object and then use its same name by default

Open JavierFuentes opened this issue 2 years ago • 5 comments

We think that these are good practices:

  • Give name (by default) to Extension Objects with the same name as its extended Object

  • Give name (by default) a Page, Report, XmlPort, etc with the same name as its referenced Object

We would like simply to change the order we enter this information in the Wizards to avoid manually copy & paste the 99% of times.

Thanks in advance...

JavierFuentes avatar Mar 29 '23 07:03 JavierFuentes

Hi

Thank you for the suggestion. I need to think how to implement it. It will probably require some settings to disable or enable it as different companies follow different rules. I cannot find any object naming rules for AL on Microsoft Docs, but old, C/AL naming conventions article is still available and I am sure that a lot of people still follow these rules: https://learn.microsoft.com/en-us/dynamics-nav/naming-conventions These old rules suggest that tables should use singular names, but list page names should be plural, or " list" and " card" if you have both card and list pages.

anzwdev avatar Apr 23 '23 13:04 anzwdev

Hi @anzwdev, I think that changing the input order of those two fields in the form should be a quick and easy thing to implement while you do your research on how to implement those MS naming convention best practices that I also try to use whenever I can.

JavierFuentes avatar Apr 25 '23 08:04 JavierFuentes

For some time now, in VSCode you can use automatic folding if you name the files properly... something like this:

image

For us it is a very useful functionality of VSCode, together with the alphabetical ordering of the files.

JavierFuentes avatar Apr 25 '23 08:04 JavierFuentes

I am not sure if changing fields order will be a good solution for everybody. Not everybody uses your naming approach and I am sure that people are already used to the current order. I will add a new settings to define fields order on all wizards.

anzwdev avatar May 01 '23 21:05 anzwdev

Just to add fuel to the fire, so to say. The MS conventions dictate certain standards, but it really depends on what you are creating.

Table "Project Setup" dictates page "Project Setup". But if you have table "Package" it would likely have multiple pages, "Package" or "Package Card" and "Packages" or "Package List"... and if we throw in a subtable like "Package Line" then we still yet have more conventions for the Page naming. And if you use other examples, e.g. User Settings, a record that is already a collection of things, it becomes more complicated. Throw in some always temp records and facade, and oh yeah, there's some complicated stuff.

I do agree that specifying the source before the name makes sense. From there we could define some regex rules depending on type. e.g. for extensions objects we follow pretty simple standards at my company, prefix + obj name + ext.

mjmatthiesen avatar Nov 10 '23 15:11 mjmatthiesen