{"id":13541513,"url":"https://github.com/TrudAX/TRUDUtilsD365","last_synced_at":"2025-04-02T09:31:53.293Z","repository":{"id":44892204,"uuid":"153742857","full_name":"TrudAX/TRUDUtilsD365","owner":"TrudAX","description":"A set of Dynamics 365 Finance and Operations Visual Studio add-ins that can help you to accelerate the development speed","archived":false,"fork":false,"pushed_at":"2024-10-15T17:05:35.000Z","size":2036,"stargazers_count":117,"open_issues_count":4,"forks_count":41,"subscribers_count":34,"default_branch":"master","last_synced_at":"2024-11-03T07:32:07.987Z","etag":null,"topics":["d365fo","xpp"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TrudAX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["trudax"]}},"created_at":"2018-10-19T07:23:55.000Z","updated_at":"2024-11-02T20:24:05.000Z","dependencies_parsed_at":"2023-11-19T06:28:13.906Z","dependency_job_id":"4a26911c-6913-4afa-a632-454a1966cab1","html_url":"https://github.com/TrudAX/TRUDUtilsD365","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrudAX%2FTRUDUtilsD365","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrudAX%2FTRUDUtilsD365/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrudAX%2FTRUDUtilsD365/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrudAX%2FTRUDUtilsD365/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrudAX","download_url":"https://codeload.github.com/TrudAX/TRUDUtilsD365/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246788602,"owners_count":20834118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d365fo","xpp"],"created_at":"2024-08-01T10:00:49.593Z","updated_at":"2025-04-02T09:31:52.918Z","avatar_url":"https://github.com/TrudAX.png","language":"C#","funding_links":["https://github.com/sponsors/trudax"],"categories":["Add-ins"],"sub_categories":[],"readme":"\n![](assets/TooBusy.png)\n# TRUDUtilsD365\n\nA set of Visual Studio Add-ins for Microsoft Dynamics 365 for Finance and Operations that will allow you to perform quickly common development tasks.\n\n* [Create extension class](#create-extension-class)\n* [Copy extension method](#copy-extension-method)\n* [Create extension](#create-extension)\n* [Enum builder](#enum-builder)\n* [Fields builder](#fields-builder)\n* [Table builder](#table-builder)\n* [Form builder](#form-builder)\n* [RunBase class builder](#runbase-class-builder)\n* [DataContract class builder](#datacontract-class-builder)\n* [Create find method](#create-find-method)\n* [Create menu item](#create-menu-item)\n* [Create security privilege](#create-security-privilege)\n* [Relation to Xpp](#relation-to-xpp)\n* [Create table relation](#create-table-relation)\n* [Troubleshooting](#troubleshooting)\n* [Installation](#installation)\n\nYou are more than welcome to contribute!\n\n## Create extension class\n\nThis Add-in works for standard Tables, Classes, Forms, Forms DS and Controls and allows you to create an extension class in one click.\n\nWhat you need to do is to enter your project prefix\n\nIt also allow you to follow naming conventions. The following standard is proposed\n\n| Standard element name       | Extension Class Name                                         |\n| --------------------------- | ------------------------------------------------------------ |\n| Table CustTable             | [ExtensionOf(tablestr(CustTable))]\u003cbr/\u003efinal class CustTableTST_Extension |\n| View AssetBalances          | [ExtensionOf(viewstr(AssetBalances))]\u003cbr/\u003efinal class AssetBalancesTST_Extension |\n| DataEntity AccountantEntity | [ExtensionOf(dataentityviewstr(AccountantEntity))]\u003cbr/\u003efinal class AccountantEntityTST_Extension |\n| Map CustVendTable           | [ExtensionOf(mapstr(CustVendTable))]\u003cbr/\u003efinal class CustVendTableTST_Extension |\n| Form CustTable              | [ExtensionOf(formstr(CustTable))]\u003cbr/\u003efinal class CustTableFormTST_Extension |\n| Form data source            | [ExtensionOf(formdatasourcestr(CustTable, DataSource1))]\u003cbr/\u003efinal class CustTableFormTST_DataSource1_Extension |\n| Form data fields            | [ExtensionOf(formdatafieldstr(CustTable, DataSource1, Field1))]\u003cbr/\u003efinal class CustTableFormTST_DataSource1Field1_Extension |\n| Button1                     | [ExtensionOf(formcontrolstr(CustTable, Button1))]\u003cbr/\u003efinal class CustTableFormTST_Button1_Extension |\n\n![](assets/CreateExtensionClass.png)\n\nYou can also setup your own naming convention rules. See [this](https://denistrunin.com/d365utils-classextensionname/) article for this details.\n\n![](assets/SetupForm.png)\n\nThis tool can be run using Right-click AddIns on Table, Class or Form..\n\n## Copy extension method\n\nThis Addins copies to the clipboard template for the method extension(with next call)\n\n![](assets/CopyExtensionMethod.png)\n\nTool can be run by Right-click method in the designer view\n\n## Create extension\n\nThis Addins creates an extension for the element from the designer view(standard tool allows to do it only from the Application Explorer)\n\n![](assets/CreateExtension.png)\n\nTool can be run by Right-click object in the designer view\n\n## Enum builder\n\nUsed for quick enum creation\n\nThe tool does the following:\n\n* Generates an enum\n* Adds values with labels from the text entry form(tries to generate element Name from the label automatically or you can specify it manually)\n* Generates EDT type for this enum\n\n  ![](assets/EnumBuilder.png)\n\nYou can run this tool from Main menu **Dynamics 365 - Addins**\n\n## Fields builder\n\nPrepare your fields in Excel and add them to the table(or table extension) in one click.\n\nUsually while adding new fields you have some specification document for the development task and can just Copy-Paste from this document to this tool. Also Excel functions can be used to auto-generate the names(like generate SlitWidth for \"Slit width\" label)\n\nThe tool does the following:\n\n* Creates EDT if it doesn't not exist (Label, Help text, Extends and String length properties supported)\n* Adds a field or an empty display method with this EDT to the table\n* Adds a new field or a method to the specified Field group\n* Creates a relation for the table if EDT has a Reference table property\n\n![1541642572075](assets/TableFieldsBuilder.png)\n\nThis tool can be run using Right-click AddIns on Table or Table extension object\n\n## Table builder\n\nThe tool helps you create a basic dictionary table (table with ID and Description fields based on \"Simple list\" template)\n\nThe tool does the following:\n\n* Creates a new EDT\n* Creates a new table with 2 fields (\"Key field name\" and Description)\n* Adds a reference for the EDT with this table\n* Adds \"find\" method for the table, adds Overview group and some default properties\n* Creates a form with this table as a data source and  adds all required controls for the \"Simple list\" template(you need manually specify template after creation)\n* Creates a new menu item for this form\n* Creates privileges\n\n![](assets/TableBuilder2.png)\n\n## Form Builder\n\nThis tool helps you create a standard form for the selected table\n\nThe tool does the following:\n\n* Creates field groups on the selected table\n* Creates a new form\n* Adds all required controls based on the selected template (you need to restore the form and manually apply the template after the creation)\n* Creates a Menu item for the created form\n\n![](assets/FormBuilder.png)\n\n## RunBase class builder\n\nAdd-in generates code template for the RunBaseBatch class\n\nSupports the following options:\n\n* Multiple dialog parameters\n* Caller record handling\n* Query usage\n* File upload control(with CSV and Excel [support](https://denistrunin.com/xpptools-readexcelfile/))\n\nSee detailed description at [RunBase template class builder](https://denistrunin.com/runbasebuilder-util/)\n\n![](assets/RunBaseBuilder.png)\n\n## DataContract class builder\n\nAdd-in generates template code for the DataContract class(used in SysOperation framework)\n\nSupports the following properties:\n\n* Mandatory\n* Groups\n* Label and Help text override\n\nAlso can generate a code template for Data provider and [Controller](https://denistrunin.com/d365utils-generatedp/) \n\n![1547085113848](assets/DataContractBuilder.png)\n\n## Create find method\n\nFor this Add-in you will need to select several fields(for the table or table extension)\n\n![](assets/CreateFindMethod.png)\n\nText for the standard **find()**, **findRecId()** and **exists()** will be generated\n\n## Create menu item\n\nThis Add-in works for Forms, Reports and Classes and creates Menu item for the selected object\n\n![](assets/MenuItemBuilder.png)\n\n## Create security privilege\n\nThis Add-in works for the selected Menu Item and creates new security privilege for this Menu Item. Label and Name are automatically updated when you change Access Level\n\n![](assets/SecurityPrivilegeBuilder.png)\n\n## Relation to Xpp\n\nThis Add-in works for the selected table relation and produces X++ code to implement this relation. Code can be generated as \"select\" or \"query\" statement\n\n![](assets/TableRelationToXpp.png)\n\n## Create table relation\n\nAdd-in creates table relation for the selected table/table-extension field based on the field EDT relation\n\n![](assets/CreateTableRelation.png)\n\n\n## Troubleshooting\n\nCurrent solution was tested on v10 U24.\n\nAll tools require that you have an active project with your current model. The first project in the solution is used.\n\nOnly basic data validation is currently implemented. In case of any problem try to debug an issue.\n\nOne of the ways to do this:\n\n* Download and install dnSpy debugger [dnSpy]: https://github.com/0xd4d/dnSpy\n* Run **dnSpy-x86.exe** file and open **TRUDUtilsD365.dll** from the VS AddinExtensions folder\n* Set the required breakpoints. Most of the logic located in ..Parms classes\n* Go to main menu Debug - Attach to process and choose Visual Studio with D365 project\n* Run Add-in in VS. The debugger should pop up\n\n  ![1541661226759](assets/DebugWindow.png)\n\nAnother option (this will run a new instance of VS)\n\n* Open the solution and set the required breakpoints\n* Got to the Project-\u003eProperty-\u003eDebug (for TRUDUtilsD365 project)\n* Set start action to \"start external program\" and specify the parameter \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\devenv.exe\"\n* Run the project\n\n## Installation\n\n### Using Power Shell\n\nThe latest version is compatible with VS2022 only(I tested it with the latest .37VHD), if you need to install the extension for VS2019, download the previous version from here https://github.com/TrudAX/TRUDUtilsD365/releases/tag/2.5.7 \n\n```powershell\n$repo = \"TrudAX/TRUDUtilsD365\"\n$releases = \"https://api.github.com/repos/$repo/releases\"\n$path = \"C:\\AAA\"\n\nIf(!(test-path $path))\n{\n    New-Item -ItemType Directory -Force -Path $path\n}\ncd $path\n\nWrite-Host Determining latest release\n[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n$tag = (Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json)[0].tag_name\n\n$files = @(\"InstallToVS.exe\",  \"TRUDUtilsD365.dll\",  \"TRUDUtilsD365.pdb\")\n\nWrite-Host Downloading files\nforeach ($file in $files) \n{\n    $download = \"https://github.com/$repo/releases/download/$tag/$file\"\n    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n    Invoke-WebRequest $download -Out $file\n    Unblock-File $file\n}\nStart-Process \"InstallToVS.exe\" -Verb runAs\n```\n\n### Manual installation\n\nDownload all 3 files from the [Releases](https://github.com/TrudAX/TRUDUtilsD365/releases). Unblock .dll and .exe files(via the file Properties). Run **InstallToVS.exe**(Run as Administrator). It will copy **TRUDUtilsD365.dll** and **TRUDUtilsD365.pdb** to the VS AddinExtensions folders.\n\nRestart VS\n\nYou can also copy these files manually, but extension path will be different for different VMs. (for 8.0 local DEV VM it will be C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\agk3do44.e2i\\AddinExtensions, for 8.1 local DEV VM: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\ugjn0jrw.pfb\\AddinExtensions, for 10.0.5 local DEV VM: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\nmjrsprb.nva\\AddinExtensions\n10.0.11 local DEV VM: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\uhv05n1m.te4\n)\n\nThe path is controlled by the following system variables: DynamicsVSTools, DynamicsVSToolsHintPath\n\nFor VM without admin access(above PU25) use the following approach: In your documents folder there is a dynamics dev config XML file.\n\n```xml\n \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e \u003cDynamicsDevConfig xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/dynamics/2012/03/development/configuration\"\u003e \t    \n  \u003cAddInPaths xmlns:d2p1=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\"\u003e \t\t \n      \u003cd2p1:string\u003eC:\\D365CustomAddins\u003c/d2p1:string\u003e \t\n  \u003c/AddInPaths\u003e   \n\u003c/DynamicsDevConfig\u003e \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrudAX%2FTRUDUtilsD365","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTrudAX%2FTRUDUtilsD365","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrudAX%2FTRUDUtilsD365/lists"}