Archive

Archive for April, 2011

How to add button to CRM 2011 form?

April 27, 2011 Comments off

Suppose you want to add a custom button in the CRM Form in 2011 note I am talking about adding button to form not ribbbon, you need to add an attribute in the entity which will then be placed in the Form design and

then the attrbute be converted in a Button at runtime using the javascript below.

The below script can be attached as a web resource file of type Script(JScript).

The Form Onload method can then call the method “create_button_from_textattributeFunction” which will actually create the custom button at runtime.

//CRM 2011 – Custom Button Creator
//Creates a Button from a Text attribute in CRM form.
//For every Button you need, create a Text Attribute and place it on the Form

function create_button_from_textattribute(fieldname, buttontext, buttonwidth,clickevent)
{
functiontocall=clickevent;
crmForm.all[fieldname].DataValue = buttontext;
crmForm.all[fieldname].style.borderRight=”#3366cc 1px solid”;
crmForm.all[fieldname].style.paddingRight=”5px”;
crmForm.all[fieldname].style.borderTop=”#3366cc 1px solid”;
crmForm.all[fieldname].style.paddingLeft=”5px”;
crmForm.all[fieldname].style.fontSize=”11px”;
crmForm.all[fieldname].style.backgroundImage=”url(/_imgs/btn_rest.gif)”;
crmForm.all[fieldname].style.borderLeft=”#3366cc 1px solid”;
crmForm.all[fieldname].style.width=buttonwidth;
crmForm.all[fieldname].style.cursor=”pointer”;
crmForm.all[fieldname].style.lineHeight=”18px”;
crmForm.all[fieldname].style.borderBottom=”#3366cc 1px solid”;
crmForm.all[fieldname].style.backgroundRepeat=”repeat-x”;
crmForm.all[fieldname].style.fontFamily=”Tahoma”;
crmForm.all[fieldname].style.height=”20px”;
crmForm.all[fieldname].style.backgroundColor=”#cee7ff”;
crmForm.all[fieldname].style.textAlign=”center”;
crmForm.all[fieldname].style.overflow=”hidden”;
crmForm.all[fieldname].attachEvent(“onmousedown”,push_button);
crmForm.all[fieldname].attachEvent(“onmouseup”,release_button);
crmForm.all[fieldname].attachEvent(“onclick”,functiontocall);
}

function push_button(){
window.event.srcElement.style.marginLeft=”1px”;
window.event.srcElement.style.marginTop=”1px”;
}

function release_button(){
window.event.srcElement.style.marginLeft=”0px”;
window.event.srcElement.style.marginTop=”0px”;
}

// tell the button what to do when clicked
function functionOnClick()
{
     alert(‘This is a CRM 2011 button click!!!!’);
}

// create the custom CRM button
function create_button_from_textattributeFunction()
{
create_button_from_textattribute(‘name’, ‘CRM 2011 Button’,’184px’, functionOnClick);
}

Advertisements
Categories: CRM

How to hide get started panel in CRM 2011?

April 15, 2011 Comments off

One of my client was irritated by the ‘Get started here’ pane which is shown by default in CRM 2011 (highlighted in image below).

Get started area CRM 2011

Get started area CRM 2011

So I started looking at ways of hiding it. The answer comes really simple. It is a setting under ‘Personal Setting option’ which has to be turned off to hide the pane for the current logged-in  user. For doing so perform the following steps

  • go to Files (appears left top of screen)
  • select options (a new dialog will open up)
  • On the general tab find the setting “Show Get Started panes on all lists” un-select to hide the get started section.
Get started panes personal setting

Get started panes personal setting

If on the other hand you want to hide get started pane for all users in the system you can do so by

  • Go to settings (left navigation area)
  • find Administration (under system section)
  • find the option by name “Show Get Started panes on all lists for all users” select no
Get started panes Admin setting

Get started panes Admin setting

Hope this helps

Categories: CRM

JScript changes from CRM 4.0 to CRM 2011

April 14, 2011 2 comments

So you want to port you CRM 4.0 Java script changes to CRM 2011. Well here is a table that can help.

Request To

CRM 4.0

CRM 2011

Set Field Value

crmForm.all.CRMFieldSchemaName.DataValue=Value

Xrm.Page.getAttribute(CRMFieldSchemaName).setValue(Value);

Get Field Value

crmForm.all.CRMFieldSchemaName.DataValue

Xrm.Page.getAttribute(CRMFieldSchemaName).getValue();

Set requirement fields

For No Requirement——————————

Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(“none”);

crmForm.all.CRMFieldSchemaName.setAttribute(“req”, 0);

Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(“required”);

crmForm.all.CRMFieldSchemaName_c.className = “n”;

Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(“recommended”);

For Recommended——————————

 

crmForm.all.CRMFieldSchemaName.setAttribute(“req”, 1);

 

crmForm.all.CRMFieldSchemaName_c.className = “rec”;

 

For Required——————————

 

crmForm.all.CRMFieldSchemaName.setAttribute(“req”, 2);

 

crmForm.all.CRMFieldSchemaName_c.className = “req”;

 

Enable/Disable fields

crmForm.all.CRMFieldSchemaName.Disabled = true;

Xrm.Page.getControl(“CRMFieldSchemaName”).setDisabled(false);

crmForm.all.CRMFieldSchemaName.Disabled = false;

Xrm.Page.getControl(“CRMFieldSchemaName”).setDisabled(true);

Hide fields

crmForm.all.CRMFieldSchemaName.style.Display = ‘none’;

Xrm.Page.ui.controls.get(“CRMFieldSchemaName“).setVisible(false);

crmForm.all.CRMFieldSchemaName _c.style.Display =’none’;

Show fields

crmForm.all.CRMFieldSchemaName.style.display = ‘block’;   OR

Xrm.Page.ui.controls.get(“CRMFieldSchemaName“).setVisible(false);

crmForm.all.CRMFieldSchemaName.style.display = ‘inline’;

Get Pick list Value

crmForm.all.CRMFieldSchemaName.DataValue

Xrm.Page.getAttribute(“CRMFieldSchemaName”).getSelectedOption().text;

Set Pick list Value

crmForm.all.CRMFieldSchemaName.DataValue= value;

Xrm.Page.getAttribute(“CRMFieldSchemaName”).setValue(parseInt(Value));

Get Lookup value

var lookupItem = new Array;

var lookupItem = new Array;

lookupItem = crmForm.all.CRMFieldSchemaName.DataValue;

lookupItem = Xrm.Page.getAttribute(CRMFieldSchemaName).getValue();

if (lookupItem[0] != null)

if (lookupItem[0] != null)

{

{

 alert(lookupItem[0].name);

 alert(lookupItem[0].name);

 alert(lookupItem[0].id);

 alert(lookupItem[0].id);

 alert(lookupItem[0].typename);

 alert(lookupItem[0].entityType);

}

}

Set Lookup value

var lookupData = new Array();

Xrm.Page.getAttribute(“CRMFieldSchemaName”).setValue( [{id: idValue, name: textValue, entityType: typeValue}]);

var lookupItem= new Object();

Or

   lookupItem.id = ‘guid‘;

var value = new Array();

   lookupItem.typename = ‘entityname‘;

value[0] = new Object();

   lookupItem.name = ‘TextVal‘;

value[0].id = guid‘;

   lookupData[0] = lookupItem;

value[0].name = TextVal‘;

   crmForm.all.CRMFieldSchemaName.DataValue = lookupData;

value[0].entityType = typeValue;

 

Xrm.Page.getAttribute(“fieldName”).setValue(value);

 

 

Tab Hide

crmForm.all.tabIndexTab.style.visibility = “hidden”;

Xrm.Page.ui.tabs.get(Tab Index).setVisible(false);

Xrm.Page.ui.tabs.get(Tab Index).setVisible(true);

OR

Xrm.Page.ui.tabs.get(Tab Name).setVisible(true);

Categories: CRM, JavaScript Tags:

What’s so cool about MS CRM 2011?

Many of my clients have been asking why they should move from CRM 4.0 to CRM 2011?

Though there is a real talk about the many new features added to Dynamics CRM 2011 which were missing in its earlier version, Dynamics CRM 4.0. I will like to cover the features that will impact you the most as an end user. With this intention I though of writing a blog about the really cool features that matters most to an end user.

1) Dialogs: Dialog is a really cool feature added to Dynamics CRM 2011. Dialogs let you design a questionnaire which the sales executive can follow when talking to a prospect. The data received from the questionnaire can be pushed into any entity record of your choice in the CRM system. Thus a questionnaire on feedback post sales can push data into a case or a presale questionnaire can push data about allocated budget of client into lead/contact record.

Does it matter to you? Of course it does as it helps you stream line the process. It lets your staff get align with the business needs and sales process. It makes sure that all information pre-post sale/purchase is always captured.

2) Connections: In CRM 4.0 “Relationship Role” could be created between contact, account and opportunity. What this meant was social relationships like father of, mother of, employee of, employer of etc could have been created to store more information about the prospect. In CRM 2011 this is now extended to all entities. I.e. now you can link an order to a contact with relationship referred sale, or Invoice to a contract or Case with any relation you need depending on your business needs. Isn’t this cool? This helps you store ad-hoc relationships between entities, which is very useful when talking to a prospect.

3) Dashboards and reports: Users are now able to leverage Microsoft Dynamics CRM for advanced business intelligence functionality. Multiple dashboards can be managed to monitor the overall performance of the business, and the dashboards of Microsoft’s CRM are intuitive and easy to navigate. The new Microsoft CRM add on allows users to benefit from being able to utilize business intelligence information to quickly and easily identify customer and market trends.

4) Ribbon & usability: The new Ribbon added at the top of CRM 2011 screens has greatly improved the usability of CRM 2011. This not only far more easy to use but also reduces time to learn and train new employee.

Categories: CRM Tags:
%d bloggers like this: