MS CRM 2011 – Hiding the Ribbon Toolbar of a Form

To hide the Ribbon toolbar of a form, use the below mentioned code snippet.

window.top.document.getElementById(“crmTopBar”).style.display = “none”;

Leave a Comment

MS CRM 2011 – Accessing Parent Form

If you want to access a parent form’s Xrm.Page object in MS CRM 2011, use the below mentioned code.

window.top.opener.parent.Xrm.Page

Leave a Comment

Update Rollup 3 for Microsoft Dynamics CRM 2011 – Released

Microsoft has released Update Rollup 3 for Microsoft Dynamics CRM Server 2011. Update Rollup 3 can be downloaded from the below mentioned link:

http://www.microsoft.com/download/en/details.aspx?id=26912

Leave a Comment

MS CRM 2011 – Auto populate unit on selection of a product in Opportunity Product

In MS CRM 2011, In the Opportunity Product form when a product is selected the unit field will not be automatically populated. So in order to populate value in the unit based on the product selected, we require a java script code to be written. So your function would look like the one mentioned below:

function ProductOnChange_SetUOM() {   
   if (Xrm.Page.getAttribute("productid").getValue() != null) {
      SetUomId();
  }
}

But there is a problem here. After placing the above code in your Product on-change event, still the unit value would not populate. Even though the Code written by you is absolutely correct, still unit value is not set. In such scenarios do not spend much time  debugging or analyzing the problem, just follow the solution mentioned below.

On product on-change, the unit field will still be read-only and hence the value set by you through code would not be assigned. So to solve this issue use the below mentioned code. On the Product on-change event call your SetUomId() method with a slight  delay, so that the unit field would not be a read-only field when you set the value.

function ProductOnChange_SetUOM() {   
   if (Xrm.Page.getAttribute("productid").getValue() != null) {
      // delay of 100ms, because uomid is readonly
    window.setTimeout("SetUomId()", 100);
  }
}

Leave a Comment

MS CRM 2011 – How to enable Audit

Auditing is one of the most important features that most customers expect MS CRM to offer as out of the box functionality. MS CRM 2011 has come up with the Auditing feature.

Change history for an entity can be tracked using Auditing feature. It allows us to track fields that have been updated on a selected entity. For example, if you want to track whenever someone changes value of a field on an entity, you can activate auditing for the entity using this option.

Follow the below steps as shown below for enabling Auditing in MS CRM 2011:

Activate Auditing for your organization

Navigate to Settings -> Auditing -> click on Audit Global Settings -> from the popup form select Start Auditing -> click OK.

Activate Auditing for the entity

Navigate to Settings -> Auditing -> click on Entity and Field Audit Settings -> Select an entity from the left navigation of the Solution editor -> General Tab -> Data Services -> Select Auditing -> click on Save

NOTE: By default all the fields for the selected entity will be enabled for Auditing.

Activate Auditing for the attribute

Click the Fields Tab to enable or disable specific fields for Auditing via Attribute editor

Publish

Publish the changes and you are ready for auditing

Audit History

Audit history for an individual entity can be viewed from the Audit History area off the entity form.  This is only available to users with the View Audit History privilege.

You can double click on the Audit transaction record to see the details

Audit Log Management

Logs are automatically “partitioned” every 3 months and it’s available for deletion via the Audit Log Management area.  This is only available to users with the privileges: View Audit Partitions and optionally Delete Audit Partitions.

Leave a Comment

MS CRM 2011 – Turn off the “Get CRM for Outlook” button / message bar

When you login to the MS CRM 2011 Web Client, you see a “Get CRM for Outlook” button / message bar only if MS CRM Outlook Client is not installed on the machine.

If you are only using the MS CRM 2011 Web Client, then you might feel that this message is not necessary.

In such cases you have the option to turn this message off by following the below mentioned steps:

Go to Settings -> Administration -> System Settings -> click on the “Outlook” tab and select “No” for “Outlook client is advertised to users in the Message Bar

Leave a Comment

MS CRM 2011 – Set the name prefix to use for custom entities and attributes

To set the name prefix to use for custom entities and attributes, navigate as mentioned below and chang the Prefix value in the Publisher form.

Go To Settings -> Customizations -> Customize the System -> Information -> Publisher

Leave a Comment

MS CRM 2011 – VPC demo image Released

Microsoft have now released a VPC demo image for Dynamics CRM 2011

https://mbs.microsoft.com/Cms/Templates/document/General.aspx?NRMODE=Published&NRNODEGUID={060C9677-229D-49E1-9F00-5E56D9F1657}&NRORIGINALURL=/partnersource/deployment/methodology/vpc/MSD_CRM2011VirtualMachine&NRCACHEHINT=Guest&wa=wsignin1.0

Two virtual machines are available:

  • Dynamics CRM
  • Exchange

Microsoft provides no software to run 64 bit VPC images on a laptop operating system like Windows 7 does. VirtualBox (http://www.virtualbox.org) runs on Windows 7 and works with Microsoft VPC 64 bit images.

Leave a Comment

MS CRM 2011 – DeletionStateCode -No longer availalbe

In MS CRM 4.0,  “soft-delete” method was used. When someone deleted a record, the record will not be actually deleted from the database immediately. Instead the record would be internally marked with IsDeleted = true, and there will be a CRM Deletion Service which will run an Asynchronous System Job once a day, which would actually pick up the records marked with IsDeleted = true and actually delete them from the database.

‘DeletionStateCode’ has been dropped in MS CRM 2011. There are no more soft deletes in CRM, the record is actually deleted from the database right away(hard delete).

When you do an upgrade from 4.0 to 2011, then you might get an error as mentioned below:

“Invalid column name ‘DeletionStateCode”

The reason for this error is that you may be using custom stored procedures and triggers in the database which were referencing to DeletionStateCode column and since this column has been removed you get error in MS CRM 2011

Leave a Comment

MS CRM 2011 – Global Option Sets

In MS CRM 4.0 Option Sets (pick lists) could only be used in one entity.  Whereas MS CRM 2011 allows us to use the Option Sets (pick lists) on multiple entities, called Global Option Sets. Global Option Sets are sets of values that are available to be re-used. Different fields can share the same set of options, which are maintained in one common place.

Steps for Creating a Global Option Set:

1. Go to Settings -> Customization -> Customize the System.
2. Select Components -> Option Sets.
3. Click on the New button.

4. Fill in the required fields and add Options to the Option Set.
5. Click on the Save button.

6. The Global Option Set will be available for use within multiple entities.

Steps for Using a Global Option Set:

Once a Global Option Set has been created, it can be used from within an entity. In this example, the Global Option Set that was created will be used in the Account entity.
1. Go to Settings -> Customization -> Customize the System.
2. Select Components -> Entities -> Account -> Forms, and then open the Main form.
3. In order to use a Global Option Set, a new field that points to it must be created. In the Field Explorer, click New Field.

4. Fill in the required data.

5. Select Option Set in the Type drop down box. Notice that Use Existing Option Set is now visible. A new Option Set can be created that is local to the Account entity or a Global Option Set can be used. Mark Yes.

In the Option Set list, select Category. If you click Edit, you can edit the Global Option Set. If you click New you can create a new Global Option Set.

7. Select a Default Value and then click Save and Close.
8. In the Field Explorer, choose the new field that was created and drag it onto the Account form.

9. Click Preview, and then click Create Form to see the Global Option Set.

10. When you are done customizing, click Save, and then click Publish.

Leave a Comment

MS CRM 2011 – JavaScript – getUserRoles

getUserRoles

Returns an array of strings representing the GUID values of each of the security roles that the user is associated with.

Xrm.Page.context.getUserRoles()

Return ValueType: Array

Example: This user has only one security role associated with their user account. The JSON representation of

this array with a single value is: ["cf4cc7ce-5d51-df11-97e0-00155db232d0"]

Leave a Comment

MS CRM 2011 – JavaScript – Entity Methods – Xrm.Page.data.entity

addOnSave – Sets a function to be called when the record is saved.

Example:Xrm.Page.data.entity.addOnSave([function reference])

function addMessageToOnSave() {
 Xrm.Page.data.entity.addOnSave(displayMessage);
}
function displayMessage() {
 alert("message");
}

getDataXml – Returns a string representing the xml that will be sent to the server when the record is saved.

Example:Xrm.Page.data.entity.getDataXml()
In this example, the following three fields for an account record were updated:
  • name , accountnumber, telephone2
"<account>
<name>Contoso</name>
<accountnumber>55555</accountnumber>
<telephone2>425 555-1234</telephone2>
</account>"

getEntityName – Returns a string representing the logical name of the entity for the record.

Example:Xrm.Page.data.entity.getEntityName()

In this example, an account record was being edited.
"account"

getId – Returns a string representing the GUID id value for the record.

Example:Xrm.Page.data.entity.getId()

The GUID Id value for the record.
"{825CB223-A651-DF11-AA8B-00155DBA3804}"

getIsDirty – Returns a Boolean value that indicates if any fields in the form have been modified.

Example:Xrm.Page.data.entity.getIsDirty()

removeOnSave – Removes a function from the OnSave event hander.

Example:Xrm.Page.data.entity.removeOnSave([function reference])

function removeMessageFromOnSave() {
 Xrm.Page.data.entity.removeOnSave(displayMessage);
}

function displayMessage() {
 alert("message");
}

save- Saves the record. This method has three possible parameters.

Example:Xrm.Page.data.entity.save( null | "saveandclose" |"saveandnew" )
Arguments
save()->If no parameter is included the record will simply be saved. This is the equivalent of the user clicking the Save button in the ribbon. 
save("saveandclose")->This is the equivalent of the user clicking the Save and Close button in the ribbon. 
save("saveandnew")->This is the equivalent of the user clicking the Save and New button in the ribbon.

Leave a Comment

MS CRM 2011 – Update Rollup 2 is available

Update Rollup 2 for Microsoft Dynamics CRM 2011 is available at the below mentioned location:

http://support.microsoft.com/kb/2466086

 

Leave a Comment

MS CRM 2011 – Hiding System Views

In MS CRM 4.0, we had to go for a plug-in or SQL update in order to remove a system generated view of an entity.

MS CRM 2011 has the ability to quickly ‘deactivate’ any system-defined or custom view. Below mentioned are the steps to deactivate/hide the system view:

  1. Go To Settings –> Customizations –> Customize the System.
  2. Navigate to the Entity and select ‘Views’
  3. Select checkbox next to the view you wish to remove
  4. Click the More Actions dropdown and select ‘Deactivate’.
  5. Save and publish your entity customizations.

Leave a Comment

MS CRM 2011 – Set focus to a field

var field = Xrm.Page.ui.controls.get(“AttributeName”);

field.setFocus();

Leave a Comment

Follow

Get every new post delivered to your Inbox.