Advertisements

Archive

Archive for the ‘ADX’ Category

StyleCop warnings failing the build in Visual Studio

Recently we got a VS project from a third party and when we try to build the project, we were getting StyleCop warnings as errors and breaking the build.

In below screen if you notice, even if all were ‘StyleCop’ warnings (i.e., Starts with SA….) build got failed with errors.

StyleCop violations as Build Errors

Reason:

  • By default, StyleCop violations only appear as warnings however StyleCop violations can be configured to fail the build by adding below tag in your project file (i.e., .csproj)

<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>

  • Coming to our reason of build failure was above line added in my Project file.

Fix:

  • Open the project file (i.e., .csproj) in notepad and remove the <StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings> tag.
  • Save the file
  • Open the Project in Visual studio and Clean & Rebuild.

🙂

 

Advertisements

The specified organization already has an active Website Binding for this site – Dynamics 365 Portals

We have 2 Portal solutions (i.e., Partner Portal and Custom Portal) enabled in our CRM organization and when I tried to configure ‘Custom Portal’ in a Web App, I could not, as the “Adxstudio Portals Website” drop down was disabled and defaulted to ‘Partner Portal’.

Active Website Binding

Reason:

  • ‘Partner Portal’ solution configured first, and it created a record in ‘Website Bindings’.
  • As design, portals defaults to ‘Partner Portal’ solution, if there was an active Website Binding.

Fix:

  • Go to the ‘Website Bindings’ in CRM, by navigating to “Advance Find -> Website Bindings”.

Website Bindings

  • Delete the website binding record

🙂

ADX Web Site Compilation Error – The type ‘System.Object’ is defined in an assembly that is not referenced.

Recently while compiling my ADX web site, I was getting below compilation exception from all my .ascx (Views) files.

Compiler Error Message: CS0012: The type ‘System.Object’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’

Issue was bit strange as I already had “System.Runtime’ dll referred in the website

Fix:

  • Open the Web.config file and add below tag inside the <compilation> tag

<assemblies>

<add assembly=”System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” />

</assemblies>

  • Your <compilation> tag should look as below

<compilation debug=”true” targetFramework=”4.5″>

<assemblies>

<add assembly=”System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” />

</assemblies>

</compilation>

Note:

  • If your <compilation> tag already had <add assembly=”…”> tags, add only <add assembly=”System.Runtime…> tag to the existing tags.

🙂

Categories: ADX, CRM, Uncategorized Tags: ,

Could not load file or assembly ‘Microsoft.Cloud.InstrumentationFramework.Events’

October 23, 2016 Leave a comment

I got the below assembly load error, while I was running my ADX Portal web site from Visual Studio.

Could not load file or assembly ‘Microsoft.Cloud.InstrumentationFramework.Events’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

could-not-load-assembly

could-not-load-assembly

Issue was not with missing .dll reference, as I already had the “Microsoft.Cloud.InstrumentationFramework.Events.dll” added to my project.

Fix:

  • Enabling an option in my Visual Studio Project fixed the issue.
  • Navigate Tools -> Options -> Project and Solutions
  • Enable “Use the 64 bit version of …” option.
Use 64 bit version

Use 64 bit version

  • Build and run the Project.

🙂

Cryptographic operation error while opening ADX portal from IIS

September 27, 2016 Leave a comment

I was getting below ‘Cryptographic operation’ error while opening ADX portal from IIS.

Cryptographic-error-adx-portal

Cryptographic-error-adx-portal

From the error, it’s clear that ADX portal encountered issue while decryption of Password.

Points to ponder:

  • When you run ADX portal for the first time, it opens Configuration screen to capture CRM organization credentials.
  • Credentials provided in Configuration screen will get saved under “../App_Data/settings.xml” file.
Configuration-screen-adx

Configuration-screen-adx

  • Password will be encrypted in Base64 string.
Settings-file-adx

Settings-file-adx

Reason:

  • In my case, “../App_Data/settings.xml” file got corrupted.

Fix:

  • Delete the ‘settings.xml’ file from your visual studio solution’s “../App_Data” folder.
settings-adx

settings-adx

  • Browse the portal
  • This time Portal, opens Configuration screen and creates a new “../App_Data/settings.xml”

🙂

Useful JScript syntax’s – ADX Portal

September 12, 2016 2 comments

CRM form script’s (i.e., Onload, OnSave, OnChange) won’t run on ADX Entity Form’s.

What if we must Get/Set, Hide/Show or Enable/Disable controls based on business logic? We need to write custom script and add in “Custom JavaScript” section of “Entity Form”.

Custom Javascript

Custom Javascript

In this article, I am providing syntax’s to Get/Set attribute values and basic validations.

Get value

Text Field:

Here ‘name’ is CRM field’s schema name.

  • var contactName=$(“#name”).val();

Look up

  • var lookupGUID = $(“#new_contactid”).val();
  • var lookupValue = $(“#new_ contactid_name”).val();
  • var entityName= $(“#new_contactid_entityname”).val();

Option Set

  • var userType = $(“#new_usertype”).val();

Set Value

Text Field

  • $(“#name”).val(“Rajeev Pentyala”);

Look up

  • $(“#new_contactid”).val(lookupId);
  • $(“#new_contactid_name”).val(lookupName);
  • $(“# new_contactid_entityname”).val(EntitySchemaName);

Option Set

Here ‘new_usertype’ is CRM field’s schema name.

  • $(“#new_usertype”).val(10000);

Note

Get/Set statements need to wrap in Document’s Ready event.

$(document).ready(function() {
// $(“#name”).val(“Rajeev Pentyala”);
});

Enable/Disable Controls

Lookup

  • It’s very tricky to Enable/Disable Lookup’s
  • Lookup control render as multiple components on ADX form, to disable lookup selection, we need to find the ‘Magnifier’ button and Hide it.

$(“#new_contactid_name”).parent().find(‘.input-group-btn’).hide(); // Find lookup’s Magnifier button and Hide it

Text

  • $(“#name”).prop(‘disabled’, true);

Validations

Custom Validation on ‘Submit’

  • On click of the ‘Submit’ button a function named webFormClientValidate is executed.
Validation-on-submit

Validation-on-submit

  • We can extend this method to add our custom validation logic.
  • In below example, I am preventing ‘Submit’, if Name is not ‘Rajeev’

if (window.jQuery) {
(function ($) {
if (typeof (webFormClientValidate) != ‘undefined’) {
var originalValidationFunction = webFormClientValidate;
if (originalValidationFunction && typeof (originalValidationFunction) == “function”) {
webFormClientValidate = function () {
originalValidationFunction.apply(this, arguments);
// Start custom validation.
// Prevent Submit if Name!=Rajeev
if ($(“#name”).val() != ‘Rajeev’) {
return false; // To prevent the form submit return false
}
// End custom validation.
return true;
};
}
}
}(window.jQuery));
}

Refer Adx portal’s blog on Custom JavaScript.

🙂

Categories: ADX Tags: ,

CRM Entity List Export to Excel – ADX Portals

September 12, 2016 Leave a comment

Of late, we got a requirement to export Opportunities from ADX portal.

We had an Entity list “Managed Opportunities” configured in CRM and we enabled Export option with a simple configuration.

Export to Excel

Export to Excel

Opportunities copied to Excel

Opportunities copied to Excel

Steps:

  • In CRM, open the entity list “Managed Opportunities”.
  • Scroll to the “Grid Configuration” section
  • Click on “+Download” from Actions.
Download Grid Action

Download Grid Action

  • And finally provide “Button Label”.

🙂