September 2008 - Posts
Description
Using the workflow editor, if you open up a custom workflow activity and being to edit a step, if that step contains a dynamic value (slug); it duplicates it. First time you add the dynamic value it works fine, after you save and close then reopen that step you'll see the dynamic value displayed twice.
eg:
before save and close: {SomeField(Entity)}
after save and close: {SomeField(Entity)}{SomeField(Entity)}
Reproduce
1. Create a custom workflow activity or compile and register one of the supplied workflows from CrmSdk 4.0*
2. Restart IIS
3. Create a new Workflow
4. Add a new workflow step (The custom activity you created/registered in step 1)
5. Assign a dynamic value to one of the properties
6. Save & Close
7. Reopen the step, you'll see the dynamic value/slug displayed twice
Fix
*Unsupported*
1. Go into the server, SFA\workflow\ folder
2. Open customactivityform.aspx in notepad
3. Find line 31 and 34, you'll see that the same call is duplicated twice, comment one of them out
We needed to display related entities in the preview view of a custom entity grid, there is no supported way of doing this, so we created a httpmodule, trapped the calls to \_grid\preview.aspx and altered the rendered html.

Here is a snippet of code. You can download the skeleton solution from here.
private void context_BeginRequest(object sender, EventArgs e)
{
if (_isEnabled)
{
HttpApplication app = sender as HttpApplication;
if (app.Request.AppRelativeCurrentExecutionFilePath.ToLower().EndsWith("preview.aspx"))
{
int type = (app.Request.QueryString["type"] != null) ? int.Parse(app.Request.QueryString["type"]) : -1;
Guid id = (app.Request.QueryString["id"] != null) ? new Guid(app.Request.QueryString["id"]) : Guid.Empty;
if (type > 0 && id != Guid.Empty)
{
app.Response.ContentType = "text/xml";
app.Response.Filter = new PreviewFilter(app.Response.Filter, type, id);
}
}
}
}
PreviewFilter.cs
public class PreviewFilter : Stream
{
private Stream _stream;
private long _position;
private int _entityId;
private Guid _objectId;
public PreviewFilter(Stream stream, int entityId, Guid objectId)
{
_stream = stream;
_entityId = entityId;
_objectId = objectId;
}
public int EntityId
{
get { return _entityId; }
}
public Guid ObjectId
{
get { return _objectId; }
}
public override void Write(byte[] buffer, int offset, int count)
{
string html = System.Text.Encoding.UTF8.GetString(buffer, offset, count);
html = "<preview>Hello World!</preview>"; // enjoy!
buffer = System.Text.Encoding.UTF8.GetBytes(html);
_stream.Write(buffer, 0, buffer.Length);
}
}
Compile, copy to the \bin\ directory on the server, open up web.config and add it to the HttpModules section.
While trying to install the CRM 4 Outlook Offline Client on a Vista SP1 machine we got the following error:
Sql Express - "Installation Failed"
Nothing in the event log and nothing listed under details. If you get the same error here is how you can get around it.
- Download SQL 2005 Express SP2
- Install it, but make sure you uncheck 'Hide advanced option' on the installer -> select 'Named Instance' -> Name: CRM
Make sure you specify the instance name as CRM, otherwise the installer will complain and say "Installation Failed".
- Run the Configuration Wizard
* If the current user is not part of the Administrators group or is not the Administrator it'll say unable to access the database.
- Download SQL Management Studio
- Go into Security -> select/add the user -> asign the SysAdmin role (full control to the sql server, I didn't bother trying to find out the minimum permission required to get CRM Outlook installed)
Another error we noticed
"An error occured loading Microsoft Dynamics CRM funtionality. Try restarting Microsoft CRM Outlook. Contact your system administrator if errors persist."
If you try opening the Configuration Wizard it says:
"Microsoft Dynamics Configuration for Outlook with offline access has already been configured for use on this computer. Only one user can be configured per computer for Microsoft Dynamics CRM for outlook with Offline Access."
To fix that make sure SQL CRM instance has been started.
Strange error messages, would have been nice if it said "Could not connect to the sql server."
While customizing CRM 4 we started noticing we were making the same changes over and over again for different clients. So we standardised CRM 4 for New Zealand. Thanks Mark for the initial idea, now we import and publish this set of customizations on any new installation.
Here is a list of all the customizations:
Account
- Removed 'Other Phone'
- Moved 'Currency' to the Administration tab
- Modified the Address section
- Physical & Postal (2 sub sections)
- Street, Suburb, City, Postal Code, Country
- Removed 'Address Type', 'Phone', 'Shipping Method'
Address
- Removed 'Phone 2'
- Moved 'Address Contact' to 'Customer Address Information'
- Modified the Address
- Address Name, Street, Suburb, City, Postal Code, Country
- Modifed the 'Preview' view
Contact
- Similar to the Account
- Modified the Views to include 'Mobile Phone' & 'Email Address'
- Removed 'Pager'
- Mapped 'Fax' field from Account to Contact
Lead
- Similar to the Contact
- Modified the 'Industry Code' to a new list from Statistics NZ
Invoice, Quote & Order
- Modified the 'Address' tab (re-arranged the fields, 'Street 3' and 'State/Province' is system locked; couldn't remove completely)
User
- Similar to the Contact
- Changed 'Service Calendar Form' to match
You can download the customizations file from: http://www.dotheyknow.net.nz/customizations_150908.zip
More Posts