Skip to main content

Posts

Report Authoring Extension Updated To Support Visual Studio 2019

 FINALLY, Microsoft has pushed an update to the Report Authoring Extension for Dynamics 365 to allow for use of Visual Studio 2019.  This update went live on 12/18/2020 and can be found here .  Installing won't be straight forward into Visual Studio 2019, even if you install everything when you first installed it.  This is because SSDT (SQL Server Data Tools) is installed but, SSAS, SSIS and SSRS are all separate modules for SSDT that you have to install separately.  While you should be fine with just installing SSRS to make this work, I would recommend just installing all 3 parts.   All of these can be found in Microsoft documentation .  In the "Install SSDT with Visual Studio 2019" section, you will see a link to the marketplace where you can download the extensions and install them.  Once that is done, download the Report Authoring Extension and run the installer.  That is it, you can now work on SSRS within Visual Studio 2019 for Microsoft Dynamics.
Recent posts

JavaScript to Allow Updating Specific Fields Post Record complete.

 Recently for a client I was given the requirement that they needed to update a custom field on activity records whether it was a completed record or not.  The problem when a record is completed, it is in read only status and users can't update the record easily, with minimal clicks.  To solve this business requirement, I wrote two JavaScript libraries. 1) UnlockFieldsOnLoad - This is the function you should list any field that you want to unlock if the record is in complete (read only status).  This function should run on load of the form and will unlock the fields so they can be updated. 2)  OnChangeUnlockedFields - This function is what will do the save when the field(s) are updated.  What it does it check to see if the record is in a read only status.  If if it is, it will make the record active again.  After it makes the record activate again, it will write the change to the database, change the status back to the original status and save that change. function UnlockFieldsOn

Code Snippets

To help speed up my development process, I decided to go down the path of creating code snippets for code blocks that I end up copying and pasting a lot.  I have published these to GitHub and will keep adding to them as I find the need to add more.  If you have any that you would like to add, please feel free to send them my way.  Here is a link to the git hub respiratory where I am keeping the code snippets. https://github.com/JamesStuder/CodeSnippets If you would like more information on howto create your own code snippets check out Microsoft's Documentation (Link Below). https://docs.microsoft.com/en-us/visualstudio/ide/code-snippets?view=vs-2019

SQL Script To Generate C# Model

While working on a data migration project that uses C# and Azure Functions.  I found myself in the need to generate a model of the table(s).  While doing a Google search I came across the following blog post  that has a script to generate the model properties for me.  Simply replace the table name variable at the top of the script with the table name you want to generate the properties for.  You may also need to include the schema name in the table name if you have multiple tables with the same name, just under different schema's.  I did make one change to it in the select @ result line.  It was adding a blank line in between each property, so I removed the new line. declare @TableName sysname = 'TABLE_NAME' declare @Result varchar(max) = 'public class ' + @TableName + ' {' select @Result = @Result + ' public ' + (CASE WHEN ColumnName = 'RowVersion' THEN 'byte[]' ELSE ColumnType END) + NullableSign + ' ' + Co

SQL Script to Create Enums For Table Columns

While working on a data migration project, using C# and Azure Functions, I found myself needing to create enums to use in my code for the columns.  Some of the tables where vary large (over 200 columns) and doing this manually would have taken a while to do it.  So, I wrote the below SQL script to create the enums for me.  To use this simply replace the table and schema variables with the schema and table name you want to generate the enums for. declare @Table sysname = '<INSERT TABLE NAME HERE>'; declare @Schema sysname = 'INSERT SCHEMA NAME HERE'; declare @Result varchar(max) = 'public enum ' + @Table + 'Columns' + ' {' select @Result = CONCAT(@Result, ' ',ColName, ' = ', SUM(ColNum), ',') from ( select COLUMN_NAME as ColName, SUM(ORDINAL_POSITION - 1) as ColNum from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = @Table AND TABLE_SCHEMA = @Schema group by

UPDATED: Setup Non-Interactive User with Non-Expiring Password

A while ago, I wrote a blog post on setting up a non-interactive user with a non-expiring password .  Since writing that post, the process has changes and I couldn't find much documentation on the process.  The part of setting up the non-interactive user hasn't changed: Setup Non-Interactive User: Create a user  in the Office 365 admin center.   Be sure to assign a Dynamics 365 (online) license to the account. Go to Dynamics 365 (online). Go to  Settings  >  Security . Choose  Users  >  Enabled Users , and then click a user’s full name. In the user form, scroll down under  Administration  to the  Client Access License (CAL) Information  section and select  Non-interactive  for Access Mode.   You then need to remove the Dynamics 365 (online) license from the account. Go to the Office 365 admin center. Click  Users  >  Active Users . Choose the non-interactive user account and under  Product licenses , click  Edit . Turn off the Dynamics 365 (online) license,

Prevent NULL inserts during updates

Recently, I had an issue that I needed to overcome.  The problem was that the Dynamics 365 instance I was working on, was integrated with multiple other systems with some long running external processes and possible old data in the UI when a record is open, overriding what the value was set to from the external processes.  What was happening is that on create of a contact, we can have a NULL e-mail.  This is normal behavior.  Our external process would be running and update the NULL e-mail field while the record was open in the UI.  Because the UI hadn't been refreshed and the user made other changes, the e-mail would be blanked out (NULL).  To make sure that the field once populated (yes, this is a business requirement) could not be cleared, I wrote a small pre-operation plugin that does the following: Check's the plugin context to see if we are trying to update the emailaddress1 or emailaddress2.   If we are trying to update either email address.  Than we check to see if