Advertisements

SQL Server Installation – VS Shell installation has failed with exit code 1638

I was getting below error during the SQL server 2017 installation.

VS Shell installation has failed with exit code 1638

Reason:

  • Exit code 1638 denotes “Another version of this program is already installed”.
  • In my case, I already had Visual Studio 2017 installed on my machine and there was conflict due to “Microsoft Visual C++ 2017 Redistributable” components which got installed with Visual Studio 2017.

Fix:

This issue was annoying and had to spend couple hours to find the actual reason and fix. Below fix worked in my case.

  • Uninstall Visual Studio 2017
  • Go to Control Panel and uninstall below ‘Microsoft Visual C++ 2017 Redistributable‘ components

VC Redist

  • Restart the machine
  • Try installing SQL Server
  • Proceed with Visual Studio 2017 installation

🙂

 

‘Portal Comment’ not showing up – Dynamics Portals

‘Portal Comment’ is an OOB activity which comes with Portal solution and enables peer-to-peer interactions between Portal Users and Dynamics Users.

To add ‘Portal Comment’ for a record, go to ‘ACTIVITIES’ tab on the form and select ‘Portal Comment’.

PC_5

Problem Statement:

  • ‘Portal Comment’ added from Dynamics on a record not showing up in Portal.
  • Below is a ‘Portal Comment’ added for Case record ‘Test’.

PC_1

  • It was not showing up on Case record on Portal

PC_2

Reason and Fix:

  • ‘Portal Comment’ will only show up on Portal, when the ‘SEND’ button clicked (i.e, Status = Completed)

PC_3

  • Now, open the record in Portal and you should see the ‘Portal Comment’
    • Note: Text added in ‘Description’ field of ‘Portal Comment’ will show up on Portal

PC_4

  • ‘Portal Comment’ can also be added from Portal by using ‘Add Comment’ button and it will show up in ‘ACTIVITIES’ tab of the record.

🙂

D 365 – Prevent Record’s Deactivate/Activate from Form – JScript

Lets see how we can apply our validation logic and prevent Deactivate/Activate of a record from Form.

Its a 3 step process:

  • Register script on form’s ‘OnSave’ event
  • Capture the ‘Deactivate/Activate’ event (i.e., by reading ‘SaveMode’ from Context)
  • Prevent Save operation

Below is the snippet to validate and prevent the Save by reading the type of operation (i.e., Deactivate, Activate, Auto Save, Save and Close, Save and New etc…).

Script :

function onSave(econtext) {
var eventArgs = econtext.getEventArgs();

// Capture Deactivation(i.e., SaveMode=5) or Activation(i.e., SaveMode=6)
if (eventArgs.getSaveMode() == 5 || eventArgs.getSaveMode() == 6) {
// Your business logic goes here
Xrm.Utility.alertDialog(“Preventing Deactivate or Activate”);
eventArgs.preventDefault();
}

// Capture AutoSave event (i.e., SaveMode=70)
if (eventArgs.getSaveMode() == 70) {
Xrm.Utility.alertDialog(“Preventing Auto Save”);
eventArgs.preventDefault();
}

// Capture ‘Save and Close’ event (i.e., SaveMode=2)
if (eventArgs.getSaveMode() == 2) {
Xrm.Utility.alertDialog(“Preventing ‘Save and Close'”);
eventArgs.preventDefault();
}
}

How to use the script:

  • Register above script on form’s ‘onsave’ event.
  • Make sure you selected ‘Pass execution context as first parameter’ checkbox.

Save_3

  • Save and Publish
  • Open the record and try to ‘Deactivate’ and you should get below popup.

Save_2

Note:

  • Script triggers only when you Deactivate\Activate only from Form.
  • It does not work from Grids or ‘Advanced find’

Refer article for the complete list of ‘SaveMode’ values.

🙂

Categories: CRM Tags: ,

DataTable – Destory() method not removing all the rows

In one of my Dynamics portal’s requirements, I had to use Data Tables table control to bind the search results.

DataTable

I used below snippet to bind the results.

var table = $(‘#customGrid‘).DataTable({
data: rows,
destroy: true,
columns: columns,
oLanguage: {
sLengthMenu: ‘Show _MENU_ items’,
sInfo: ” <b>Showing _START_ – _END_ of _TOTAL_ items</b>”,
sInfoEmpty: ‘ <b>Showing 0 – 0 of 0 items</b>’,
sEmptyTable: “No data to display”
},
‘columnDefs’: [
]
});

In the above snippet

  • #customGrid – Is ID of a HTML <Table> object which we use for DataTable.
    • <table id=”customGrid” class=”display”></table>
  • rows – JSon collection

Problem statement:

I am using ‘DataTable’ in one of my custom HTML Search pages

  • I was binding the Search results to the DataTable up on Search button click and have to clear the previous results when no match results found.
  • I was calling destroy() function to clear off the rows from previous Search.

if ($.fn.DataTable.isDataTable(“#customGrid”)) {
$(“#customGrid”).DataTable().destroy();
}

  • However, destroy() its not removing all the rows.

Reason and Fix:

  • destroy() remove all defined events and properties of DataTable object.
  • Its not clearing the <table> object rows (This may have fixed or changed in latest versions)
  •  So, to clear the rows, you must call empty() function of <table> object.
  • Below is the final code

if ($.fn.DataTable.isDataTable(“#customGrid”)) {
     // Destroy ‘DataTable’ object
$(“#customGrid”).DataTable().destroy();
    // Remove the <table> rows
    $(“#customGrid”).empty();
}

🙂

Categories: Misc Tags: ,

Dynamics 365 – Broken ‘Notes’ control on the form and Fix

If you have upgraded to latest Dynamics 365 version or subscribed for 30 days trail and could not add a note or attachments in ‘Notes’ tab on form, this fix is for you.

Problem statement:

  • Could not add a Note or add attachment from ‘Notes’ control on form.
  • ‘Notes’ panel rendering as below with no ‘Enter a Note’ option

Notes-1

  • It seems product issue and will be fixed in future updates.

Fix worked for me:

There is no documented fix for this, however below steps worked for me.

  • Open the entities ‘Customization Form’ which you have problem with.
  • Double click and open the ‘Notes’ tab

Notes-4

  • Under ‘Web Client Properties’, select ‘Default tab’ property as highlighted below.

Notes-3

  • Save & Publish
  • Go back to the form and refresh.
  • You should see option to add Note.

Notes-2

🙂

 

D 365 – ‘Voice of the Customer’ solution installation failed

Other day, I was getting solution installation failure error while installing “Voice of the Customer” on my trail instance.

VOC 2

Issue was persisting even after multiple retries.

Reason:

  • I tried to install solution from “Manage your solutions” screen, which is the reason for failure (This approach used to work in CRM 2016 till Dynamics Version 9)
  • This is not the proper way of installing ‘Voice of the Customer’ solution from Version 9, as per the documentation available here

Fix:

So the right way to install  ‘Voice of the Customer’ solution, from V9, is from ‘Applications’ tab of your ‘Dynamics 365 Admin Center’

  • Connect to your Office 365 Portal
  • Go to the Dynamics 365 Administration Center, and then select the Applications tab.
  • Select the application row titled Voice Of The Customer, and then select Manage.

VOC 3

  • In the next screen, pick your instance and click ‘Install’

VOC 1

  • To track the progress, go to “Dynamics 365 Administration Center“, Select the instance name, and then select Solutions.
  • The status is displayed in the Status column.

To know more on the usage of ‘Voice of the Customer’ solution, refer my article

Quick Notes:

  • Up on the ‘Voice of the Customer’ solution installation, a new “VOC Push Service user”  (Application User) is created automatically.
  • This Application User will allow Voice of the Customer Azure service to authenticate with Dynamics 365 using Server-to-Server (S2S) authentication.
  • As this “VOC Push Service user” is an “Application User” no additional license will be consumed.
  • To know more about S2S authentication with Application User, refer my article

🙂