Showing posts with label CRM 2011. Show all posts
Showing posts with label CRM 2011. Show all posts

Monday, April 30, 2012

Visually Differentiate Dynamics CRM 2011 Environments (alternate)

I am a big fan of this hack to visually differentiate CRM environments and have been using it religiously in all CRM environments I have worked on.
I have since found an implementation of for CRM 2011 here. Although it served its purpose, I was not quite comfortable with changing the ribbon styles as it could be a annoyance when designing/implementing ribbon icons. So here is my take on it:
There are 2 files that require modification; main.css.aspx and theme.css.aspx (The theme.css.aspx file only needs to be modified if you want this to work with read-only forms). You can find them both under %programfiles%\Microsoft Dynamics CRM\CRMWeb\_common\styles folder.

main.css.aspx

div.ms-crm-TopBarContainerGlobal
{
/* background-repeat: no-repeat;
background-color: #ffffff; */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff00', endColorstr='#0100ff',GradientType=1 ); /* IE6-9 */
}

div.ms-crm-TopBarContainerForm
{
/* background-repeat : repeat-x; */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff00', endColorstr='#0100ff',GradientType=1 ); /* IE6-9 */
}

themes.css.aspx
div.ms-crm-ToolBar
{
<%--<% = this.GetStyleCss(CrmTheme.Current.Form.ToolBar) %>--%>
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff00', endColorstr='#0100ff',GradientType=1 ); /* IE6-9 */
}

The gradients were generated using CSS gradient editor.

IIS Reset for the changes to take effect.


An here is the end result:
image

image

As this is an un-supported change, you would not be able to implement this in a CRM Online environment. Here is an alternate solution that works well with CRM Online.

Friday, April 13, 2012

Listing of Form Mode For Organization Users

With rollup update 7, Dynamics CRM introduced Read-Optimized Forms and gave administrators the ability to set the default Form Mode for all users within the organization. It also provides the option to allow users to override this selection as well.

Dynamics CRM Default Viewing Mode
Dynamics CRM Default Individual

If the latter option is enabled, I noticed that CRM does not provide administrators a way to view the user’s selection. This information is not available in any of the out of the box views nor can it be added as the Form Mode selection is stored within the UserSettings entity.
The following FetchXml used within a SSRS report should fill the requirement gap:
<fetch mapping="logical" count="50" version="1.0">
  <entity name="systemuser">
    <attribute name="address1_telephone1" />
    <attribute name="businessunitid" />
    <attribute name="fullname" />
    <attribute name="siteid" />
    <attribute name="title" />
    <filter>
      <condition attribute="isdisabled" operator="eq" value="0" />
    </filter>
    <link-entity alias="settings" name="usersettings" from="systemuserid" to="systemuserid">
      <attribute name="entityformmode" />
    </link-entity>
  </entity>
</fetch>

Read-Optimized Forms Enabled Users 

And best of all, this method is fully supported.

Thursday, April 12, 2012

Calculated Fields In Dynamics CRM Read Optimized Forms

The latest rollup update introduced a new feature called Read Optimized Forms. This enables a read-only version of the entity forms that optimized for users that want to rapidly read data instead of editing them.

One of the pre-requisites in the current implementation is that the form should be devoid of all script customizations. If so, how would you work around a situation where the form requires values to be dynamically calculated.

One of the recommended approaches, as defined in the SDK, is to use a synchronous sandbox plugin running on the Retrieve message of the entity.

The following code snippet demonstrates this:

  1. protected void ExecuteDynamicCalculationPlugin(LocalPluginContext localContext)
  2. {
  3.     if (localContext == null)
  4.         throw new ArgumentNullException("localContext");
  5.  
  6.     //The OutputParameters property bag contains the result of the core operation.
  7.     Entity outEntity = localContext.PluginExecutionContext.OutputParameters["BusinessEntity"] as Entity;
  8.  
  9.     //Ensure values are valid to perform calculation
  10.     if (outEntity.Attributes.Contains("null_hours") &&
  11.         outEntity.Attributes.Contains("null_days"))
  12.     {
  13.         int hours = (int)outEntity.Attributes["null_hours"];
  14.         int days = (int)outEntity.Attributes["null_days"];
  15.  
  16.         outEntity.Attributes["null_hours"] = hours * days;
  17.     }
  18. }

crm2011 post event registration

And the plugin is registered as PostOutsideTransaction on the Retrieve event of the entity with the assembly under Sandbox isolation. This approach would also work on Online solutions as well.

Please beware of long running calculations as they are now being done synchronously as opposed to being done asynchronously through JavaScript.

Sunday, April 08, 2012

Dynamics CRM Security Role with Minimum Permission

When it comes to software solutions, it is always best practice to follow the Principal Least Privilege. This is no different with Dynamics CRM 2011. This post will provide you will basic instructions in creating a security role with the least privileges.

The help page in the Security Role entity under the “Create or edit a security role” topic already provides a pretty good summary of the minimum privileges required:

It's helpful to keep in mind the minimum privileges you need to define for some common tasks. These include:

  • When logging in to Microsoft Dynamics CRM:
    1. To render the home page: prvReadWebResource, prvReadCustomization
    2. To render an entity grid (that is, to view lists of records and other data): Read privilege on the entity, prvReadUserSettings, prvReadQuery
    3. To view single entities in detail: Read privilege on the entity, prvReadSystemForm, prvCreateUserEntityUISettings, prvReadUserEntityUISettings
  • When logging in to Microsoft Dynamics CRM for Outlook:
    1. To render navigation for Microsoft Dynamics CRM and all Microsoft Dynamics CRM buttons: prvReadEntity, prvReadQuery
    2. To render an entity grid: Read privilege on the entity, prvReadCustomization, prvReadWebResource, prvReadUserQuery
    3. To render entities: Read privilege on the entity, prvReadSystemForm, prvCreateUserEntityUISettings, prvReadUserEntityUISettings, prvWriteUserEntityUISettings

So suppose I want a user to have minimum read permission to a Custom Entity and for him to view records that have been assigned to him. I would add the following permission:

Basic Read Permission on your entity (prvRead[entityName])

EntityReadPermission

Access to Viewing the entity grid and entity forms (prvReadQuery, prvReadSystemForm)
As well as the permissions that are added by default (prvReadSdkMessage, prvReadSdkMessageProcessingStepImage, prvReadSdkMessageProcessingStep, prvReadPluginAssembly, prvReadPluginType) These permissions are required for smooth operations of internal operations such as core CRM plugins.

Forms and Views

The UserEntity UI Settings provides access to the functionality to remember the user’s last accessed Form (prvCreateUserEntityUISettings, prvReadUserEntityUISettings)

User UI Settings

Permission to access User Preferences (prvReadUserSettings)

UserSettings

Also keep in mind that when designing security roles, a good understanding of the organization structure and deployed CRM solutions is key to success. As it is possible that there are additional plugins and workflows running in the background that require additional permissions.

Tuesday, February 01, 2011

Dynamics CRM 2011 Books

https://community.dynamics.com/roletailored/customerservice/b/cscrmblog/archive/2011/02/01/microsoft-dynamics-crm-2011-book-club.aspx

Pretty impressive line up of Dynamics CRM 2011 books to be released during this year. Its going to be an interesting year ahead.

Sunday, January 16, 2011

Whitepaper for ISV and Developers

The November release of the Whitepaper for ISVs and Developers can be found here. Its a nice presentation of the available customization options without diving too deep into the technical details.

http://community.dynamics.com/product/crm/crmtechnical/b/crmteamblog/archive/2010/11/10/new-microsoft-dynamics-crm-2011-whitepaper-for-isvs-and-developers.aspx

Wednesday, October 06, 2010

CRM 2011 Beta SDK Sept/Oct Refresh

I'm not sure how I missed this, but there was a new update to the 2011 SDK a few days back.

Most notably they've added hands-on-labs and tons sample code. Sweet!

Go get the latest version here.

Friday, August 13, 2010

CRM 2011 New Features And The Wait or Build Decision

Some interesting thoughts on whats new in CRM 2011 and how it affects applications we build today.
http://www.dynamicscrmtrickbag.com/2010/08/06/crm2011-waitorbuild/
http://www.dynamicscrmtrickbag.com/2010/07/25/taking-the-covers-off-crm-2011/

In my opinion, if time permits, I would always try opt for the wait; at least until the beta releases of the product come out.
From my past experiences early adoption has worked out pretty good for us. It gives us the opportunity to offer the customer so much more value in their solution.

The development cycle may not be the smoothest, but at the end of the day the rewards are worth it.