Book Release: Dynamics Deep Dive Security

On February 13, 2012, in CRM 2011, Dynamics CRM, by Mitch Milam

Today I am releasing the first in a series of Deep Dive books related to all things Dynamics CRM:

The first book is a dive deep into Dynamics CRM 2011 security where you will discover what really happens behind–the–scenes.

We will cover the following topics:

  • Business units
  • Security roles and privileges
  • Users and teams
  • Auditing
  • Field-level security
  • Record ownership and sharing
  • How Dynamics CRM applies security at the Active Directory and SQL levels

You’ll learn how to troubleshoot security-related issues and learn how the design of your entities and the relationships with other entities effects security..

We'll also show you how to create custom security roles for users of your Help Desk and that need to have form customization capabilities but not be able to change or remove metadata.

Also included is a complete list of Dynamics CRM security privileges which allows you to cross reference the information found in the Dynamics CRM user interface with their internal names.

Finally, we'll discuss best practices as applied to each security sub-topic to help you to quickly get up to speed with Dynamics CRM security.

Currently, it is available in PDF format with paper and eBook ( Kindle, nook, iBook ) coming soon.

Visit the book page to make a purchase.

 

Tagged with:  

Sometimes I get a requirement to set the initial value for a DateTime field, such as the Due Date of the Task Entity, to Today's date.  OR, someone would like to set the hour of a DateTime field to something other than Midnight, which is the default.

JavaScript to the rescue:

Add this function to the web resource that contains the JavaScript for your entity:

function SetDefaultDateTimeValue(attributeName, hour, minute)
{
    // FORM_TYPE_CREATE = 1
    if (Xrm.Page.ui.getFormType() == 1)
    {
        var attribute = Xrm.Page.getAttribute(attributeName);

        if (attribute.getValue() == null)
        {
            attribute.setValue(new Date());
        }

        attribute.setValue(attribute.getValue().setHours(hour, minute, 0));
    }
}

 

Make the form's OnLoad function, look something like this:

function Form_OnLoad()
{
    SetDefaultDateTimeValue('scheduledend', 8, 0);
}

Results

The results of this operation look like this:

image

 

SetDefaultDateTimeValue Function

The function I created takes three parameters:

attributeName Name of the DateTime attribute you wish to set
hour The hour of the day to set ( can be zero )
minute The minute of hour to set ( can be zero )

 

You would call this function once for each of the form fields that you wish to set. Just change the parameters passed as necessary.

 

Other Notes

You will notice that I am checking the Form Type before performing any work. A form type of 1 is a Create Form which is the form type for a New record within CRM. We put this check in place so that we only populate our fields for new records. The fields of existing records will remain unchanged when opened.

This is how the Form Events look after having wired up a JScript web resource and specifying the OnLoad event:

image

Tagged with:  

Free Plugin Configuration Solution Released

On February 8, 2012, in Development, Dynamics CRM, by Mitch Milam

I updated my Plugin Configuration solution to work as a real solution within Dynamics CRM 2011.

You will find it on the Free Solutions page.

Included in the zip file are:

  • An unmanaged solution
  • A managed solution
  • Sample code ( below )

 

Usage:

Perform the following steps to add the solution to your system:

1. Import the solution into CRM. In the Settings area, you'll find a Plugin Settings link.

2. Add a record to specify a plugin configuration setting. There are three parameters:

  • Plugin Name
  • Setting Name
  • Setting Value

As shown in the figure below:

image

 

In your plugin, you'll need to add a method to extract get your setting:

public static string GetPluginConfigSetting(IOrganizationService service, 
                       string pluginName, 
                       string pluginSettingName)
{
    var queryByAttribute = new QueryByAttribute("m3_pluginsetting");
    queryByAttribute.Attributes.AddRange(new [] { "m3_pluginname", "m3_settingname" } );
    queryByAttribute.Values.AddRange(new object[] { pluginName, pluginSettingName });
    queryByAttribute.ColumnSet = new ColumnSet();
    queryByAttribute.ColumnSet.AddColumn("m3_settings");

    var retrieved = service.RetrieveMultiple(queryByAttribute);

    if (retrieved.Entities.Count > 0)
    {
        return retrieved.Entities[0].Attributes["m3_settings"].ToString();
    }

    throw new InvalidPluginExecutionException(
              "Unable to retrieve configuration settings.");
}

 

This method is called like this:

UnsecureInformation = GetPluginConfigSetting(crmService, "MyPlugin",
                                            "ConnectionString");

 

 

Alternatives

The Adxstudio Productivity Pack for Dynamics CRM 2011 has a similar feature so that is an alternative if you need one.

Tagged with:  

CRM Export JavaScript Updated

On February 7, 2012, in CRM 2011, Customization, Dynamics CRM, by Mitch Milam

I updated the utility exports to disk the JavaScript found in a solution in Dynamics CRM 2011. To read more about it, see the original announcement, found here.

This updated fixes some issues where the JavaScript would not be exported depending upon the solution you selected and the solution you chose to export. ( it was basically a design-flaw on my part. )

If you are running IFD using ADFS to access your CRM system, then you may be unable to connect to CRM. If you receive a 401 error, then please let me know.  I am currently working with Microsoft to determine a course of action around this issue.

Otherwise, if you find any issues, then please let me know.

Tagged with:  

CRM Find Privilege Utility Updated

On February 6, 2012, in Administration, Dynamics CRM, by Mitch Milam

I've corrected some issues I found with the utility that allows you to look up User and Privilege information by ID:

You my find it on my Free Utilities page.

Tagged with:  

Dynamics CRM News: CRM Anywhere

On February 6, 2012, in CRM 2011, Dynamics CRM, by Mitch Milam

Dennis Michalis, Microsoft Dynamics General Manager, released the roadmap for the upcoming Q2 2012 release of Dynamics CRM 2011, which they are calling R8. Read more about it here.

The actual roadmap document can be found here.

Looks like we're in for some exciting times this year!

Tagged with:  

We have released a small update to the CRM Migration Assistant which includes the following updates:

  1. Added 0 and 1 as supported Submit Options
  2. Fixed issues with converting .AddOption to .addOption method.
  3. Conversion alerts were added for the following JavaScript properties:
  • .title
  • .vAlign
  • .contentEditable
  • .innerText
  1. Any .style property that is not either display or visible is now marked as a conversion issue. This is to help identify instances where people have created unsupported code which will probably not work within the CRM 2011 environment.
  2. The use of document.all.mnuBar1 now produces a conversion alert.
  3. Instances of the DOM element 'Notifications' will cause a conversion alert will be generated. This is a special CRM form element at the top of each data entry form that shows alerts to the user. For more information on using this technique, see this article.

 

You may download the new package here.

Tagged with: