"тнιѕ вℓσg ¢συℓ∂ ѕανє уσυя мσηєу ιƒ тιмє = мσηєу" - ∂.мαηנαℓу

Saturday 2 May 2015

JS Development in CRM 2013- Tips

    This post is regarding a javascript development tip which is very useful in CRM 2013. It was not my idea but one of my colleague's (Alex). And it was an eye opener for me. As we all know we write js code on form load as well as on change event of different fields in CRM 2013. At a later point have you ever struggled to see on which fields we have js code ?  I have. Alex's suggestion was to use attach events by using the addonchange js function in CRM 2013. He also mentioned that this would make the js code more transparent. addonChange function is nothing but a js function to be called when the attribute changes. Please read the comments below. Thanks to Alex for this recommendation.

//Form Load
//onLoad function should be added to the Form load event of Form editor as usual
function onLoad() {

    FillData();// FillData Function call on Form load
    attachEvents();
}


//Function to attach events to different fields
function attachEvents() {

    //Attach Onchange event of lookup1(new_City) and lookup2(new_Profession)
    //You could attach as many fields as you prefer
    //Please note that the function name is passed as a parameter to addonchange function
    //Its the function we would like to call during onchange event of these fields.
    Xrm.Page.getAttribute("new_City").addOnChange(FillData);
    Xrm.Page.getAttribute("new_Profession").addOnChange(FillData);
    //No need to add FillData function call on the onchange event of each field on
    //the Form editor instead here we attach it using addOnChange function.
}

//Fill data based on lookup1 - new_City and lookup2 - new_Profession
function FillData() {

    //Js code to fill in the field based new_City and new_Profession
     //For instance you could fill another field using these 2 field values
}


Monday 12 May 2014

SDK for CRM 2013 OR CRM 2013 SDK version 6.1.0 May 2014 OR Duplicate Detection in CRM 2013

Hello Everyone,

 The latest SDK could be found in the following link.

http://www.microsoft.com/en-gb/download/details.aspx?id=40321


And here is a glad news for all of us.

(REF: "http://msdn.microsoft.com/en-us/library/gg309589.aspx" )

"Detect duplicates when you create or update records
We listened to your feedback! The capability to detect duplicates when you create or update records using forms or grid views in the web application for the updated user interface (UI) entities has been restored in this release! New in this release is the ability to detect duplicates when you use CRM for tablets. More information: Detect duplicate data"
Its worth to read the following link as well.




Sunday 22 December 2013

New CRM 2013 SDK

New CRM 2013 SDK could be downloaded from the following link

http://www.microsoft.com/en-us/download/details.aspx?id=40321


This download inludes UII as well.

"User Interface Integration (UII) solution framework, which includes a deployment guide, development guide and api reference. UII uses Microsoft Dynamics CRM for the delivery of configuration data for the Integrated Agent Desktop. It includes development and run-time components. Applications built with UII can provide unified access to customer information across different systems and can aggregate different modes of customer interactions or channels." (REF: Microsoft CRM 2013 SDK Download).

Thursday 14 November 2013

Form Notification in CRM 2013 using Javascript OR How to Display Form Level Notifications in CRM 2013 using Javascript

For Field Level Notifications, please refer the below post.


Form Notification is an interesting feature in CRM 2013.

Syntax:
Xrm.Page.ui.setFormNotification(message, level, uniqueId);
message- string
uniqueId- string
level - string, possible values are given below.
Following are the 3 possible form notifications ( Called Levels )
 ( CRM 2013 SDK )
  • ERROR : Notification will use the system error icon.
  • WARNING : Notification will use the system warning icon.
  • INFO : Notification will use the system info icon.
Lets try to understand this with a sample scenario. And later you could make changes as per your scenario.

Scenario: We have Credit limit and Annual revenue fields on the Account form. If the user enters a credit limit value greater than annual income and try to save the form, we need to notify the user with a message that the credit limit shouldn't cross the Annual revenue value. 

Here is the js code to display a 'Warning' notification.

function onSaveSetCreditLimitFormNotification()
{
var annualRevenue=Xrm.Page.getAttribute("revenue").getValue();
var creditLimit= Xrm.Page.getAttribute("creditlimit").getValue();

if(creditLimit > annualRevenue)
{
Xrm.Page.ui.setFormNotification("Sorry, Credit Limit should be less than the Annual Income","WARNING","CreditlimitMessage");

}
else
{
Xrm.Page.ui.clearFormNotification("CreditlimitMessage");

}

}

In this case, we would call the function on the Onsave event of the form ( Account )

We need to include this code in a Webresource file and make the function call as shown below.




Save the form and  Publish it.The next step is to test the results.


So we got the warning notification as shown. And notification gets cleared for the right value.


Similarly we could have info notification

Xrm.Page.ui.setFormNotification("Sorry, Credit Limit should be less than the Annual Income","INFO","CreditlimitMessage");

For which we gets the below info notifcation.


Error notification is also possible as show below.

Xrm.Page.ui.setFormNotification("Sorry, Credit Limit should be less than the Annual Income","ERROR","CreditlimitMessage");




Wednesday 13 November 2013

Ribbon Editor for CRM 2013 OR Ribbon Customization in CRM 2013 using tool

As you all know, Ribbon customization has got a great significance in CRM 2013 as well.

I would like to recommend the following Ribbon Customization tool. Please note that I haven't tried all scenarios but got good outcomes for the customization that I tried with this tool.

It provides a good overview of the Ribbon structure in CRM 2013. In my opinion its a nice tool.

The installation and short demo could be found in the below link. Also you could find the Ribbon Workbench download links.

Ribbon workbench by Scott Durow -- "http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx"

( Ref: http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx)