0% found this document useful (0 votes)
98 views15 pages

Guidelines Extensions (Table Level) Best Practices

AX 2012

Uploaded by

charan nalluri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
98 views15 pages

Guidelines Extensions (Table Level) Best Practices

AX 2012

Uploaded by

charan nalluri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 15
FE) Kishor Jadhav 2 D365 F&O | Technical | My Learning | Table ao Extensions Kishor Jadhav 2 D365 F&O Technical Consultant | DevOps | Power Platform | Blogger = Infosys Published Apr 12, 2020 4 \ \_+ Follow) Naming guidelines for extensions 1. Naming extensions (Table, View and Forms) © Suffix the name with the term Extension. For example, an extension of the InventLocation table should follow the pattern InventLocation.Extension. FE Kishor Jadhav 2 * Don't name the extension just .Extension, For example, an extension of the InventLocation table must not be named InventLocation.Extension, because the risk of conflicts is too high. 2. Naming extension for logic on Tables, Classes or other elements Start the name of the extension class with the name of the type that is being augmented and end the name with the term _Extension. For example: Extension class for ContactPerson table should start with the name ContactPerson and end with _Extension like ContactPersonWHS_Extension. Use model name infix like to avoid conflicts. Extend Table: To extend table go to table name, right click and select Create extension / Create extension in new project * Create Extension : This will add extension to the current project * Create extension in new project : It will create a new project and will add the extension. e FE Kishor Jadhav tye veter <> View code BB Fieldt i EB Open table browser Alt+O Fields B rum th Index Add to project [1 Add to new project ft 5 : a Relat! 35. Create extension in new project i“ Gd State Overlayer PveH Agence compare. SEB Gish EE TmpFon Find references FE TmpFon View references EB Tmpfrt View hierarchy El TmpGer @ Refresh | | | | | | | | | | | | | | | | | | | EE TmpHel| | | Properties FA TmpHierarchyDesigner (sys) Note: © Before creating table extension please check the respective table is part of current model package references. If table is in different model, then Create extension option will be disabled. * To enable this option, you need to update model reference. Go to tab Dynamics365 > Model Management > update model parameters Kishor Jadhav © Vata types 4 EE Data Model « Tables 1 EE AbbreviationStanina_[Anolication Suitel 2 EB Accountan| 8B Accounti BE Accounting 3B Accounting EB Accour BE Accountin EB Accounting ® ACOCestC| BB ACOCostc: 5B AcQsourng Es} ACOsournd e AcOlourng HE AcOjourna & AcoPanam . Open designer View code Open table browser Alte project Add to new project Duplicate in project Create extension in new project Advanced compare... Cirle K, Cire A Find references View references View hierarchy Refresh Properties 8B ACOProdCostiable BK [Application Sumte) FE Kishor Jadhav 2 Packages [Models] [1] AccountsPayableMobile [Accounts Payable Mobile] (1 ApplicationCommon [Application Common] (11 ApplicationFoundation [Application Foundation] 1] ApplicationFoundationFormAdaptor [Application Foundation Farm Ac ApplicationPlatform [Application Platform] Oo” licationPlatformFormAdaptor [Application Platform Form Adaptor 1] ApplicationSuiteFormAdaptor [Application Suite Form Adaptor] 1 Application Workspaces [Application Workspaces] 1 ApplicationWorkspacesFormAdaptor [ApplicationWorkspacesFormAd: 1 Banktypes [BankTypes] a Back Ned Cancel Modify existing fields in a table through extension To modify properties on an existing field in a table, you must first create an extension for the table. You can modify the following properties: Label Help text Country Region Codes Extended Data Type — You can select only extended data types (EDTs) that are derived from the currently selected EDT. The lookup in the property sheet is filtered so that only those EDTs are shown. For example, to edit the EDT on the Width field in the FE Kishor Jadhav the Invent Table extension, In this way, you can modify the look and feel of the Width field in the user interface when the new package is deployed ee SevvceCoaeTabie IN ff SkipintaComparySync. RU soncode if StandoraConfigtd df StondaranveneCotora if Standaratovertsizla $f Standaraloventiyotd si standoraPaterQuantity if SttisiesFacor sl TaraWeight ‘of TaxotionOvigin BR «if TaxtscalCtosication BR si TaxPackagingQty § TaxServiceCode BR if UnieVotume 8 Useattemid of Wiaeh wis WMSArvatanaingTime di WespaterTypala il WasPicingQayTime i DSN HiSNCodeTabie IN xem IN ServiceAccountingCodeTabteN Visible Behavior Allow Exit ‘Allow Eait On Create Data os Authorization County Region Codes Country Region Context Field Currency Code CCutency Code Fels Add fields to tables through extension (Reference : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev- itpro/extensibility/add-field-extension) To add a new field to an existing table, you must first create a table extension. For example, to add a field that holds the radius of the released product, you must create an extension for the InventTable table in your model, as shown in the following illustration. FE Kishor Jadhav 2 Fes = 18 Field groups 5 Solution UniedOperations' (1 projet) & esos 4-5 UniedOperations3 (USR) [MyTablefatensonMode) 1 fu Tee naexes Bi Fields b BB Field groups Allow Duplicates Yes ates Alternate Key No *H MylnventLocationid ee 7 bi ttemide ae == WB hesrcdinelie Index Type Index » wniae Name MyWarchouseldx Doh Productiax Tags > S InventfiscalliFOGrouplde ae une Oe. bh, BeiseTanatCodes.1Nide Sa lime Netee > CustomsFenortTanifCodoTable INtce Modify table properties through extension You can now modify the following properties through the property sheet: * Created By * Created Date Time * Modified By * Modified Date Time * Country Region Codes By setting the Created By, Created Date Time, Modified By, or Modified Date Time property to Yes, you help guarantee that a corresponding field is added to the table. Corresponding tracking information about the user is then stored in the table when FE) Kishor Jadhav 2 By adding country or region codes to the list, you help guarantee that the corresponding table is also applicable when the system runs in the context of the specified country or region. Add methods to tables through extension To add method on the extension table we should create augmentation class. For example, a new field that is named MyInventLocationId was added to the InventTable table through extension. A data event handler was also created for the Inserting event, and you must implement the logic of filling the new field there. To encapsulate that action, you will create a new method on InventTable and name that method myDefaultInventLocationId. ‘You first create a new class in the extension model. This class will augment the InventTable table and enable access to the table's fields and methods in a manner that is easy to read and understand. It's important that you choose the correct name for your augmentation class. (ExtensionOf(tableStr(InventTable))] final class InventTableMy_Extension public void myDefaultInventLocationld() FE) Kishor Jadhav 2 this. MyInventLocationld = this.inventLocationId(); // Other methods These methods will then appear in IntelliSense for variables of the InventTable type, just as if they were defined directly on the table. This behaviour applies to both static methods and instance methods There are a few rules for augmentation classes: * They must be final © They must be suffixed by Extension. © They must be decorated with the [ExtensionOf(] attribute. Thanks, Kishor Jadhav Email: kishorworld! @gmail.com Skype: kishorworld FE Kishor Jadhav 2 Like Comment Share To view or add a comment, sign in Others also viewed Jes ee Top 10 issues discovered from Dynamics AX Code Review Bertrand Caillet - 6y D365 F&O: Update data entity staging table data before data is transferred to target table Manish Singh - 6mo Explore topics Workplace Job Search Careers Interviewing Salary and Compensation Internships Employee Benefits See All © 2022 About Accessibility User Agreement Privacy Policy Cookie Policy FE) Kishor Jadhav Language

You might also like