Pages

Tuesday, 23 October 2018

update organization fails from Dynamics CRM CRM2016 to D365

I noticed that many people get error while upgrading organization from CRM2016 to Dynamics 365 .

There are mainly two reason for this

1. New Microsoft.Xrm dll not getting updated in GAC while installing Dynamics 365 update.
    I suggest GAC it manually this DLL

2. Duplicate record create in metadata table mostly in optionset value . Find duplicate in metadata table and delete from SQL through query

Tuesday, 26 December 2017

Trigger events on select of Business process flow Stage CRM2016


Attach event onLoad of CRM2016 Form

function onload()
{

Xrm.Page.data.process.addOnStageSelected(stageselected);

}

function stageselected(args) {

alert(Xrm.Page.data.process.getSelectedStage());

}

Trigger events on change stage of Business process flow in CRM2016

Display tabs on CRM2016 form based on Business process flow stage changes


// Attaching event onload of form
function onload()
{
Xrm.Page.data.process.addOnStageChange(stagechange);
Xrm.Page.ui.tabs.get("tab_2").setVisible(true);

}

function stagechange() {
alert("sucess");
Xrm.Page.ui.tabs.get("tab_2").setVisible(false);

}

CRM2016 - Navigate Associated view from Entity form Without moving to top Sitemap

Recently i had a requirement : user should able to navigate SP document  associated view by clicking HTML web resource button on CRM2016 form .


i use below code on to achieve this


Xrm.Page.ui.navigation.items.get("navdocuments").setVisible(true);


Xrm.Page.ui.navigation.items.get("navAddresses").setFocus();


Wednesday, 7 September 2016

Error "Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory.XXXXXXXXX" while connecting CRM service

When you get error 'Microsoft.IdentityModel.Clients.ActiveDirectory.XXXXXXXXX' while connecting service .Kindly  refer "Microsoft.IdentityModel.Clients.ActiveDirectory.dll" which is available in CRM2016 SDK\ bin folder .


Connect CRM 2016 organization service in C# using Tooling.Connector

CRM 2016 SDK does not have "microsoft.xrm.client.dll"  . We can now use "Microsoft.Xrm.Tooling.Connector.dll"  instead of "microsoft.xrm.client.dll" .


Sample Code

Addreference
Microsoft.IdentityModel.Clients.ActiveDirectory.dll
Microsoft.Xrm.Tooling.Connector.dll

public IOrganizationService creatOgraservice()
        {
            String ConnectionString = Config._CRMservice;
            CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(ConnectionString);
            _org = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
            return _org;
        }


Monday, 5 September 2016

CRM 2016 Synatax changes after disabling legacy form rendering engine (enable Turbo forms)

Old code for disable view picker of look up ( before disabling legacy form rendering )

document.getElementById("LookupField").disableViewPicker=1;


New code (After enabling turbo forms)

var lookup="schemaname of field";
lookup.Ctl=Xrm,page.getControl("schemaname of field");
lookuo.SetParameter("disableViewPicker", "1");