Wednesday, January 11, 2012

Pre-Image & Post Image in CRM plugin

Plugins in Dynamics CRM, allow you to register images against the steps of a plugin assembly. Images are a way to pass the image of the record that is currently being worked upon prior or after the action has been performed. In general it could be said, it is the image of the record as is available in the SQL backend.

Two types of Images are supported, Pre-Image and Post Image.

In case of Pre-image, you get the image of the record as is stored in the SQL database before the CRM Platform action has been performed.
Post Image, returns the image of the record after the CRM Platform action has been performed.

The following table explains the Pre-Image Availability

The following table explains the Post-Image Availability
  

Monday, January 9, 2012

Customer Care Accelerator (CCA)

image


Microsoft Dynamics CRM 4.0

Microsoft Dynamics CRM 4.0, along with Microsoft® Windows Server® 2003 or Windows Server 2008, is the primary software prerequisite for installing the software that supports integrated agent desktop development and deployment.
The Microsoft Dynamics CRM server acts as the configuration store and administrative system for agent desktop projects that you create using User Interface Integration (UII)-based technologies.


User Interface Integration (UII)

UII is a set of client-side binaries that support the core functions involved in creating an integrated agent desktop solution. It includes the following:
·         The core desktop compositing engine. These are the binaries that enable you to design an integrated agent desktop shell.
·         The Application Integration Framework (AIF). AIF enables hosting of applications within the agent desktop shell and provides a mechanism for sharing information between those applications.
·         Hosted Application Toolkit (HAT) and Microsoft Visual Studio® tools. HAT is a Visual Studio guidance packages that enables you to quickly automate applications that you want to host in your agent desktop shell. Another Visual Studio tool is a template you can use to create an integrated agent desktop solution.

Customer Care Accelerator (CCA)

CCA is an integrated agent desktop reference implementation and sample application built by using UII.

Integrated Contact Center (ICC)

ICC is a Microsoft Consulting Services (MCS) solution offering for the customer care and contact center market






Friday, January 6, 2012

Canceling the Save operation in CRM 2011



Method 1:

Add an OnSave event to the form:


Note: The pass execution context as first parameter checkbox is very important to this process. Without it, it will not work.

Inside the Contact_main_library.js web resource, we’ll add the following function:
function Form_onsave(executionObj)
{
var shouldSave = true;

if (shouldSave)
{
alert("Unable to save because of some reason or the other.");

executionObj.getEventArgs().preventDefault();
}
}
Inside the OnSave function, we need to have some type of test to see if we should allow the record to be saved.
For this demonstration, we simply check the value of a variable called shouldSave. If true, then we display an error message to the user then execute the preventDefault() method which will instruct CRM to cancel the save operation.

Method 2:
Add an OnSave event to the form:
//if event.Mode is one means Save, event .Mode is two means Save&Close.
if(event.Mode == 1 || event.Mode ==2)
{
event.returnValue = false;
return false;
}

Reference :-
Gangs036-MS-CRM-Blogspot: Canceling the Save operation in CRM 2011

calculation of duration between two days in crm2011

to calculate duration

// get both dates from the form....
function Testing()
{
var start = Xrm.Page.getAttribute("new_staredate").getValue();
var end = Xrm.Page.getAttribute("new_enddate").getValue();

// to cancel the error when undefined
if (start==undefined || start==null || end==undefined || end==null) {
return;
}

// Get 1 day
var day=1000*60*60*24;
// Get time in days...
var time = ((end-start)/day)+1;

// Can't be less than 0.
if (time<0) time=0;
// Set the duration
Xrm.Page.getAttribute("new_noofdays").setValue(time);
}

Reference :-
Gangs036-MS-CRM-Blogspot: calculation of duration between two days in crm201...

calculation of duration between two days in crm4.0 using javascript


// to calculate duration

// get both dates from the form....
var start = crmForm.all.activeon.DataValue;
var end = crmForm.all.expireson.DataValue;

// to cancel the error when undefined
if (start==undefined || start==null || end==undefined || end==null) {
return;
}

// Get 1 day
var day=1000*60*60*24;
// Get time in days...
var time = ((end-start)/day)+1;

// Can't be less than 0.
if (time<0) time=0;
// Set the duration
crmForm.all.new_duration1.DataValue = time;

Reference :-
Gangs036-MS-CRM-Blogspot: calculation of duration between two days in crm4.0...:

Saturday, November 5, 2011

JavaScript for Disabling a field once its contains a value in crm 2011

 Write this javascript in onload event of a form

     if( Xrm.Page.data.entity.attributes.get('new_consultant').getValue() !=null)
     {
         var AddressType = Xrm.Page.ui.controls.get('new_consultant');
         AddressType.setDisabled(true);
     }

Thursday, November 3, 2011

Javascript to validate to Phone No in CRM 2011

function checkisinteger()
{
  var s=Xrm.Page.getAttribute('telephone1').getValue();
  if(s!=null)
  {  
    var i;
    for (i = 0; i < s.length; i++)
    {
        // Check that current character is number.
        var c = s.charAt(i);
       if (((c < "0") || (c > "9"))) break;
    }
    if(i    {
     alert("Enter a valid phone number");
     Xrm.Page.getAttribute('telephone1').setValue("");
    }
 }
}