Development Guideline - Best Practices - D365 F&O

Rumman Ansari   Software Engineer   2023-05-11   1777 Share
☰ Table of Contents

Table of Content:


Development Guideline - Best Practices

Think that you are working for the company "ATNYLA".

Model

There are 3 models namely,

  1. ATNYLAHelixCustomizations - Contains all Helix customizations
  2. ATNYLACCustomizations - Contains all Corp customizations
  3. ATNYLACIntegrations - Contains some integration customizations

Use primarily the ATNYLAHelixCustomizations model for any new development unless if the objects belong to other models, the continue your changes in the same model (Do not extend artifacts from ATNYLACCustomizations & ATNYLACIntegrations into ATNYLAHelixCustomizations model)

Projects

  • All developments will be tracked under DevOps types as Modification, Bug, Change request

  • TDD will be tracked as one or more Modifications depending on the no. of independent customizations

  • The project name should be defined as [MOD/BUG/CR] [DevOps ID] - [Short Description]

    Example:

    • TDD – Return Order management [MOD 82910 – RET Order Mgmt]

    • BUG – RWA should not open for customer on credit hold [BUG 77856 – RWAForAccOnCreditHold]

Project Structure

Under the project we should follow the folder structure

All class should be inside a folder called “AxClass”

All tables should be inside a folder called “AxTables”

…..

 

New Objects

All new application object elements should start with prefix ATNYLA.

Format: [ATNYLA]ObjectName

Configuration key for all newly created object: ATNYLA

Examples:

  • ✺ New EDT – ATNYLATreadDepth

  • ✺ New Table – ATNYLAWarrantyClaimTable

  • ✺ New Class – ATNYLAUpdateClaimDataService

  • ✺ New Enum – ATNYLA<EnumName>

Object Extensions

Application object extensions should have suffix [.ATNYLA]

Format: ObjectName[.ATNYLA]

Examples

  • Table extension – SalesLine.ATNYLA

    1. Any new filed added inside the table should start with “ATNYLA” prefix

    2. If any new method added, name should start with “ATNYLA” prefix

  • Form extension – DeliveryTerms.ATNYLA

    1. Any control added externally, control name should start with “ATNYLA” prefix

    2. Any new method added, name should start with “ATNYLA”

  • Entity extension – VendVendorV2Entity.ATNYLA

  • Enum extension – SalesStatus.ATNYLA

    1. New element name should start with prefix “ATNYLA”

Event Handler Class for Table

Event handler class for table should be named as [ATNYLA] TableName[EventHandler]

Example: ATNYLASalesLineEventHandler

Extension class for Table/Class

The extension class for table/class should be name as [ATNYLA]TableName[_Extension]

Example:

Table extension - ATNYLASalesLine_Extension


/// <summary>

/// Extension methods for the <c>SalesParmTable</c> table

/// </summary>

[ExtensionOf(tableStr(SalesParmTable))]

final class ATNYLASalesParmTable_Extension

{

}

Class extension – ATNYLASalesFormLetter_Extension


/// <summary>

/// Extension class of SalesFormLetter

/// </summary>

[ExtensionOf(classStr(SalesFormLetter))]

final class ATNYLASalesFormLetter_Extension

{

}

Coding guideline

1. No hard code string inside the code, always use label

2. Try to avoid all inline query instead of that AOT query

3. Always use multiline comment format instead of single line comment


/*
comment here
*/

4. For lengthy and complex method try to use inline comment for better readability and understanding

5. For any conditional statement always use {} even if single line statement


If (true)
{
  A =b;
}

// Not like below

If (true)
 A =b;

6. All variable name should have some busines name and follow camel casing naming convention.


 Correct: qbdsSalesOrder 
 Not: qbds1 

7. For any query or select statement please use the required field list instead of selecting all field.

8. If only one record is selecting please use firstonly.

9. For new tables, EDTS, View, forms use Microsoft define best practice along with [Company like Capgemini, Accenture, Cognizant, TCS, Infosys, Wipro] best practice

10. No commit on any reference table data inside modified field method, as user may be press esc button and undo the changes. But we left will commit data in reference table.

Instead of that use updated event handler and use original buffer and current buffer to compare changes.

Labels

New labels required should be created under ATNYLA_en-US

We should use prefix “ATNYLA” for label id

Comments

All modifications should have comments describing the DevOps Id for modifications/bug/change request and self-explanatory description.

Format: [Date (mm/dd/yyyy)] - [TCS] – [userid] - [BUG/MOD/CR] - [DevOps Id] - [Description]

Example:


//05/17/2021 - CompanyName[atnyla]- exta-<userid> - MOD 82910-RET Order Mgmt - Copy program information from sales invoice to return order – Start

<change code>

//05/17/2021 – CompanyName[atnyla]- exta-<userid> - MOD 82910-RET Order Mgmt - Copy program information from sales invoice to return order – End