Thursday 27 July 2017

{Know-how} Add a ribbon button using Ribbon WorkBench

Hello,

Though its an age old topic, would like to write down step-by-step approach to add an ribbon button for reference.

Prerequisite:
CRM instance with ribbon workbench solution  or Xrmtoolbox



Scenario:
Add a ribbon button on account and on click of the ribbon button show the URL of the record.

Steps:
  1. Open ribbon workbench
  2. Select the solution that contains account entity. 
  3. Add a new js command. Using command we can define JavaScript function or an URL action called on click of ribbon button.
  4. Lets add a Javascript action and call our Alert function which is available in existing Js webresource
  5. Now add the ribbon button and fill in the necessary details. Also link the command to the button and publish the changes
  6. Once done navigate to account and click the button to view the alert
Code snippet to alert URL:
 function alertURL() {  
 var url= "{0}/main.aspx?etn={1}&id={2}&pagetype=entityrecord"  
  Xrm.Utility.alertDialog( url.replace("{0}",Xrm.Page.context.getClientUrl()).replace("{1}", Xrm.Page.data.entity.getEntityName()).replace("{2}", encodeURIComponent(Xrm.Page.data.entity.getId())));  
 }  


HTH! Please leave your feedback on comments section!

Wednesday 26 July 2017

{Know-how} Dynamics 365 - SSRS pass prefiltering report parameter and open report using URL - JavaScript


Reporting is an essential part in any system. In Dynamics CRM, we have wide variety of reporting options that are flexible enough to meet most of the requirements and one such scenario is explained here. At times we may need to open a report via URL inside an IFrame or in a new window based on the requirement and in our scenario it is new window.


Scenario:
On click of a ribbon button in an account record, open account prefiltered report in a new window.

Code Explanation:
To form a report URL we need following
  1. Organization URL - Organization URL  and in my case https://contoso.crm.dynamics.com
  2. Report Id- unique identifier of the report
  3. Action - It can be either run or filter and for our scenario it should be run
  4. Context - It should be records
  5. ETC - Entity type code and in our case its for account
  6. Record Id - unique identifier of the current record
Note: The parameters 4,5 and 6 are specific to prefiltering. Skip the same if you want to run a report without preregistering


JavaScript code snippet:
             var orgUrl = Xrm.Page.context.getClientUrl();  
             var action = "run";  
             var context = "records";  
             var reportId = "report id goes here";
             var recordid = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");  
             var etc = Xrm.Page.context.getQueryStringParameters().etc;  
             var url = orgUrl +  
               "/crmreports/viewer/viewer.aspx?action=" + encodeURIComponent(action) +  
               "&context=" + encodeURIComponent(context) +  
               "&id=%7b" + encodeURIComponent(reportId) + "%7d" +  
               "&records=%7b" + encodeURIComponent(recordid) + "%7d" +  
               "&recordstype=" + encodeURIComponent(etc);  
             var customParameters = encodeURIComponent(url);  
             Xrm.Utility.openWebResource("reportcontainer.html", customParameters)  

HTH! Please leave your valuable feedback in comments!

SSRS shared dataset deployment error - The feature: "Shared dataset" is not supported in this edition of Reporting Services.



Today I was deploying reports using visual studio and faced a weird error while creating shared dataset. The error is as follows

The feature: "Shared dataset" is not supported in this edition of Reporting Services

After a bit of analysis found that issue is related to the edition of SQL Reporting server. Only certain editions of SQL server supports shared datasets and the rest doesn't.

Refer this Microsoft article for more information.

The following are the editions that should not support shared datasets
  • Web
  • Express with Advanced Services
  • Express with Tools
  • Express

and the below are the one's which should support the same
  • Enterprise
  • Standard
  • Developer

Wednesday 12 July 2017

{know-how}Dynamics CRM 365 - Query Hierarchical data - D365


Hierarchical querying, an interesting way of retrieving data for analysis, transforming and reporting. In latest version of CRM, we can use fetchxml to query and retrieve hierarchical data.

The hierarchical data retrieval in fetchxml can be achieved using following filter condition operators
  • above
  • eq-or-above
  • under
  • eq-or-under
  • not-under
  • eq-owneduseroruserhierarchy
  • eq-useroruserhierarchyandteams
Prerequisite:
Make sure the specific relationship is hierarchy enabled.
Sample Scenario:
Find all child account hierarchy for the parent account.

Fetchxml:
In the below fetchxml the highlighted operator called under will fetch all the accounts that are under the given accounts hierarchy.


<fetch>
    <entity name="account" >
        <all-attributes/>
        <filter type="and" >
            <condition attribute="accountid" operator="under" value="a9df53b3-e31c-e711-8108-5065f38af901" />
        </filter>
    </entity>
</fetch>

Try all the above filter operators and also refer below MSDN article for more info and do not forget to go through restrictions.

https://msdn.microsoft.com/en-in/library/dn817893.aspx

Happy learning!

Saturday 8 July 2017

Dynamics 365 CRM July 2017 update - List of depreciated functionalities in D365

Hello All,

With the new upcoming D365 CRM July 2017 Update, some of functionalities are depreciated and their usage will be supported by Microsoft until they are officially removed. This list is based on the D365 customer engagement announcement from Microsoft team and the same helps in new release readiness.

In general, whenever a feature is depreciated, its better to start using the alternative immediately as the depreciated functionality will be removed anytime sooner or later.

As an architect or developer, its important to know the latest list of depreciated functionalities and start replacing them in future developments and upgrades. 

Below are the list of depreciated functionalities apart from some of the client API's
  • Dynamics 365 for Outlook (Outlook client)
  • Dynamics 365 for Outlook (Outlook client) is deprecated
  • Service scheduling in Dynamics 365 for Customer Service is deprecated
  • Dialogs are deprecated
  • Usage of Parature knowledgebase as the Dynamics 365 knowledge management solution is deprecated
  • Project Service Finder app is deprecated
  • Contracts, Contract Line Items, and Contract Templates entities are deprecated
  • Standard SLAs in Dynamics 365 for Customer Service are deprecated
  • Relationship Roles are deprecated
  • Mail Merge is deprecated
  • Announcements are deprecated
  • Ready-to-use business processes available through Add Ready to Use Business Processes setting are deprecate
  • EntityMetadata.IsInteractionCentricEnabled property is deprecated
  • Silverlight (XAP) web resource is deprecated
Reference with full details on depreciated functionalities and their replacements: https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming

Disclaimer: This details are based on Microsoft D365 customer engagement announcements and the purpose of this blog post is to spread awareness.

From Microsoft docs regarding this topic:
The announcements and deprecations described in this topic apply to Dynamics 365 Customer Engagement as of the July 2017 Update. Administrators and IT professionals should use this information to prepare for future releases of Dynamics 365. Customer Engagement refers to the applications that make up the CRM portion of Dynamics 365, which includes the Sales, Customer Service, Field Service, and Project Service Automation applications.
“Deprecated” means we intend to remove the feature or capability from a future major release of Dynamics 365. The feature or capability will continue to work and is fully supported until it is officially removed. This deprecation notification can span a few years. After removal, the feature or capability will no longer work. We are notifying you now so you have sufficient time to plan and update your code before the feature or capability is removed.

Dynamics 365 CRM July 2017 update - List of depreciated JavaScript client API's in D365

Hello All,

With the new upcoming D365 CRM July 2017 Update, some of client API's are depreciated and their usage will be supported by Microsoft until they are officially removed. This list is based on the D365 customer engagement announcement from Microsoft team and the same helps in new release readiness.

In general, whenever a feature is depreciated, its better to start using the alternative immediately as the depreciated functionality will be removed anytime sooner or later.

As an architect or developer, its important to know the latest list of depreciated functionalities and start replacing them in future developments and upgrades. 

Apart from other depreciated functionalities, below are the list of client API's that are depreciated,

Xrm.Page
Xrm.Page.context
Xrm.Page.context.getQueryStringParameters
Xrm.Page.context.getTimeZoneOffsetMinutes
Xrm.Page.context.getUserId
Xrm.Page.context.getUserLcid
Xrm.Page.context.getUserName
Xrm.Page.context.getUserRoles
Xrm.Page.context.getIsAutoSaveEnabled
Xrm.Page.context.getOrgLcid
Xrm.Page.context.getOrgUniqueName
Xrm.Page.data.entity.save(string)
Xrm.Page.data.entity.getDataXml
GridRow.getData
GridRowData.getEntity
Xrm.Mobile.offline
parent.Xrm
addOnKeyPress
removeOnKeyPress
showAutoComplete
hideAutoComplete
Xrm.Utility.alertDialog
Xrm.Utility.confirmDialog
Xrm.Utility.isActivityType
Xrm.Utility.openEntityForm
Xrm.Utility.openQuickCreate
Xrm.Utility.openWebResource

Reference with full details on depreciated API and their replacements: https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming

Disclaimer: This details are based on Microsoft D365 customer engagement announcements and the purpose of this blog post is to spread awareness.

From Microsoft docs regarding this topic:
The announcements and deprecations described in this topic apply to Dynamics 365 Customer Engagement as of the July 2017 Update. Administrators and IT professionals should use this information to prepare for future releases of Dynamics 365. Customer Engagement refers to the applications that make up the CRM portion of Dynamics 365, which includes the Sales, Customer Service, Field Service, and Project Service Automation applications.
“Deprecated” means we intend to remove the feature or capability from a future major release of Dynamics 365. The feature or capability will continue to work and is fully supported until it is officially removed. This deprecation notification can span a few years. After removal, the feature or capability will no longer work. We are notifying you now so you have sufficient time to plan and update your code before the feature or capability is removed.