Search This Blog

Thursday, July 30, 2009

Tools update : Secure connection added

As you might have noticed, my tools didn't support SSL when establishing connection with CRM Server...

It is now corrected! All tools can access crm website using https

The next update will be to enable IFD authentication... Stay tuned!

NB: I put all download links on the right pane of this blog

Monday, July 27, 2009

New tool! Bulk Delete Launcher

Today, a new tool that allows you to run bulk deletion of records. Indeed, this feature of CRM is not accessible through the user interface but only with SDK.

To use this tool, you must first create a view in the advanced search that will find the items you want to delete.

Then just run the tool, to indicate on which entity (using the logical name of the entity) is the view advanced search and set scheduling options and recurrence (if desired).

You can also request to receive an email from the CRM server when processing is complete. This option is available if the user account you use has an email address saved in the user profile CRM.



Thursday, July 9, 2009

Workflow: Add rich HTML content in email body

One of the limitations of workflow in Microsoft Dynamics CRM 4.0 is the uncapability to add dynamic HTML content. By dynamic, I mean with data from the item that triggered the workflow.

We all know the trick of copy/paste to add static HTML in the mail but to add dynamic content is a different kettle of fish ...

In particular, I think about the following needs:
  • Display a table containing the information related to the current record (eg list of contacts from an account)
  • Show a link to a form without displaying any url but just a clickable word
Note that it is possible to manage these cases with custom workflow activities. In fact, when you insert a workflow output text in an email, the content is not encoded, ie you can pass HTML tags that will be interpreted as such.

For example:

<a href="aLink">Click here</a>

will just display

Click here

In the same way, you can display HTML table with CRM content and insert it in mail body.

[UPDATE] Code example - Url builder. This code create an hypertext html control that will be used in email body. You can set a text for the hypertext control with the input property and you get back the hypertext control in output property

   1: public class EntityUrlHelper : SequenceActivity
   2: {
   3:     public static DependencyProperty linkProperty = DependencyProperty.Register("link", typeof(string), typeof(EntityUrlHelper));
   5:     [CrmOutput("Link")] public string link
   6:     { 
   7:         get 
   8:         { 
   9:             return (string)base.GetValue(linkProperty); 
  10:         } 
  11:         set 
  12:         { 
  13:             base.SetValue(linkProperty, value); 
  14:         }
  15:     }
  16:     public static DependencyProperty textLinkProperty = DependencyProperty.Register("textLink", typeof(string), typeof(EntityUrlHelper));
  18:     [CrmInput("Hypertext link text")]
  19:     public string textLink
  20:     { 
  21:         get 
  22:         { 
  23:             return (string)base.GetValue(textLinkProperty); 
  24:         } 
  25:         set 
  26:         { 
  27:             base.SetValue(textLinkProperty, value); 
  28:         }
  29:     }
  31:     protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
  32:     { 
  33:         IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService)); 
  34:         IWorkflowContext context = contextService.Context;
  36:         link = "<a href='http://someUrl/page.aspx?id=" + context.PrimaryEntityId.ToString() + "'>" + textLink + "</a>";
  37:         return ActivityExecutionStatus.Closed;
  38:     }
  39: }

Tuesday, July 7, 2009

Plugins and update record state: Do I have to use message SetState or SetStateDynamicEntity

One question that came to me while I had to develop a plugin when record state changed...

The answer is quite simple if you understand how the CRM application communicates between the presentation layer and data access layer. In fact, all communications between the forms and the data access layer seem to be in the form of DynamicEntity.

So when you change the status of a record via the forms, or when you use the SDK class SetStateDynamicEntityRequest, you register your plugin on the SetStateDynamicEntity message .

If you use in your code SetStateAccountRequest class (for example), you must register your plugin on the SetStage message.