Pages

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");



Monday, 8 August 2016

CRM2016 useful features

-> Create customer attributes for any entity : you can define customer look up for system and custom entity .

-> Apply SLA to additional entities

-> Categorize entity records in CRM

->Control how packages are deployed with the enhanced package deployer

-> Enhanced Web API

-> New entities , for example BookableResource ,BookableResourceBooking etc.