Dynamics 365





Monday, November 27, 2017

Loading IFrame on form - MS CRM Dynamics javascript

This is helpful to set the URL to IFRAME using javascript in MicroSoft Dynamics CRM.

use below script as reference to your javascript webresource.

you need to call the SetTransactionFrame() from onload even and save event of crm form.

// script to webpage to Iframe .. load web page on MS CRM form IFRAME.



var transactionsURL = "http:blogger.com";

function SetTransactionFrame()
{

 var subjectValue = Xrm.Page.getAttribute("subjectid").getValue();

 if ((subjectValue != null)) {
 
var subjectName = subjectValue[0].name;


var formType = Xrm.Page.ui.getFormType();
    if (formType !== 1 && subjectName=="yoursubject" )
        {
SetIFrameURL();
}
else
{
//"Details" - tab name
Xrm.Page.ui.tabs.get("Details").sections.get("Details_section_2").setVisible(false);
}

   }
}

function SetIFrameURL() {

    var CaseId = Xrm.Page.data.entity.getId();
    var UserId = Xrm.Page.context.getUserId();
   var FormType ="case";

    var transactionsURL = TransactionDetailsURL + '?id=' + CaseId +'&userid=' +UserId +'&typename='+FormType;


Xrm.Page.getControl('IFRAME_Transactions').setSrc(transactionsURL);
}

Sunday, November 19, 2017

CRM 2011 Visual Ribbon Editor - Ribbon editor for dynamics CRM 2011/2016


CRM 2011 Visual Ribbon Editor


https://crmvisualribbonedit.codeplex.com/

using CRM Visual Ribbon Editor - Edit the Ribbon add button to ribbon



You can add bottom with functionality to any entity in MS CRM.

1.) Before adding button to ribbon , Create a java script web resource and add a simple function

web resource name: new_getCustomerDetails

function getDetails(){

alert("here you go");

}

2.) Have a any button Image of 16x16 size and 32x32 size ready
button name: new_btnDetails - Upload as Image web resource.

3.) Now ready to add button to ribbon
Open ribbon editor by clicking VisualRibbonEditor.exe



And connect to CRM by passing credentials and URL

Once you successfully logged in to tool select entity to add the button.
it will load he corresponding entities ribbon on tool.

Once ribbon loaded Please select the group where you need to add the button.

Details Tab: click new button.and give name and label, Select the 16x16 and 32x32 image of button.

Action Tab: Select the the previously defined web resource: new_getCustomerDetails and give function name as  getDetails .

now save and export the solution.
and refresh the entity. you will see the new button.







Change data source for SSRS report in MS CRM

Change data source  for SSRS report in MS CRM

First Step to find out Reprting server url

Go to your SQL Server Reporting Services and find url 

http://servername:port/reports


 CRM Organization folder that contains your list of CRM reports.

Find the report using search box. once you get the report right click and manage.

go to data source and define correct path then apply changes.

click ok

now go to MS crm reports and open report .


Activate key In MS CRM 2016

Follow below steps to activate the key.

when you restore the DB backup you need to activate the data encryption key

otherwise you may get issue while sending email messages

Go to Settings > Data Management > Data Encryption. Once you click the Data Encryption link, a dialog opens that gives you the ability to activate the data encryption key. Click “Activate” to activate the Data Encryption

You may encounter below issue while activate,make sure you have proper permissions on MS CRM DB

add svc_crmpreprdadmin user to PrivUserGroup security group or ask your admin to add.








Thursday, March 9, 2017

Default Activity ‘Next 30 days or earlier’ to ‘All’ Dynamics CRM 2016


here is the javascript code to change the default filter of Account or Contact - Activities Filter to "All"

Default Activity ‘Filter on’ to ‘All’ Dynamics CRM 2016


Create a web resource on Account or Contact entity
Call below function on onLoad of Account or Contact entity.



function filterAllActivities() 
{
    parent.window.document.getElementById("navActivities").onclick = function () 
    {
           parent.window.Mscrm.Details.loadArea(this, "areaActivities");
           parent.window.document.getElementById("areaActivitiesFrame").onload = function () 
           {
               var entityName = Xrm.Page.data.entity.getEntityName();
              var entity = entityName.charAt(0).toUpperCase() + entityName.substr(1);
               var doc = this.contentWindow.document;
               var filterOn = doc.getElementById("crmGrid_" + entity + "_ActivityPointers_datefilter");
    
               filterOn.value = "All";
    
            var evt = document.createEvent("HTMLEvents");
            evt.initEvent("change", false, true);
            filterOn.dispatchEvent(evt); 
         };
    };