31 Aralık 2010 Cuma

Get Entity/Attribute's Display Name from CRM database


The Display Name for CRM Entity/Attribute is always a special case. In CRM 3.0, the Display Name is saved in the table: OrganizationUIBase, column: FieldXml. To get the Display Name for each attributes isn't an easy job. My approach was transfer the FieldXml column(NVARCHAR) into XML type, then get data from there. Here's the code I'd like to show about how to get the Display Name from CRM 3.0 (I suppose that you only want to see entity Account and Contact):



-- Get the display name from xml field
USE [Contoso_MSCRM]
GO
SELECT CONVERT(XML, REPLACE(CONVERT(NVARCHAR(MAX), O.FieldXml),'' ,'')) AS XmlField
INTO #temp1 FROM OrganizationUIBase O
WHERE NOT EXISTS(SELECT 1 FROM OrganizationUIBase WHERE Version>O.Version AND ObjectTypeCode=O.ObjectTypeCode)
SELECT DISTINCT
t2.x.value('(../../@objecttypecode)[1]','int') AS ObjectTypeCode,
t2.x.value('(../../@name)[1]','nvarchar(100)') AS EntityName,
t2.x.value('@name', 'nvarchar(50)') AS AttributeName,
t2.x.value('(displaynames/displayname/@description)[1]','nvarchar(100)') AS DisplayName
INTO #temp2
FROM #temp1 AS t1 CROSS APPLY t1.XmlField.nodes('/entity/fields/field') AS t2(x)

-- Join the metadata database
USE [Contoso_METABASE]
GO
SELECT
Entity.Name AS EntityName,
Attribute.Name AS AttributeName,
#temp2.DisplayName AS AttributeDisplayName,
FROM Attribute
INNER JOIN Entity ON Attribute.EntityId = Entity.EntityId
INNER JOIN #temp2 ON #temp2.AttributeName = Attribute.Name AND #temp2.ObjectTypeCode = Entity.ObjectTypeCode
WHERE EntityName IN ('Account', 'Contact')
ORDER BY EntityName, AttributeName

DROP TABLE #temp1
DROP TABLE #temp2



In CRM 4.0, because it supports multi languages, so the database has been re-designed: the FieldXml field has been abandoned. Instead, Microsoft uses a new table: LocalizedLabelView to save the Entity/Attribute's Display Name, it's much easy to get the Display Name, same example here (English version, the LanguageId is 1033):



USE Contoso_MSCRM
GO

SELECT EntityView.Name AS EntityName, LocalizedLabelView_1.Label AS EntityDisplayName,
AttributeView.Name AS AttributeName, LocalizedLabelView_2.Label AS AttributeDisplayName
FROM LocalizedLabelView AS LocalizedLabelView_2 INNER JOIN
AttributeView ON LocalizedLabelView_2.ObjectId = AttributeView.AttributeId RIGHT OUTER JOIN
EntityView INNER JOIN
LocalizedLabelView AS LocalizedLabelView_1 ON EntityView.EntityId = LocalizedLabelView_1.ObjectId ON
AttributeView.EntityId = EntityView.EntityId
WHERE LocalizedLabelView_1.ObjectColumnName = 'LocalizedName'
AND LocalizedLabelView_2.ObjectColumnName = 'DisplayName'
AND LocalizedLabelView_1.LanguageId = '1033'
AND LocalizedLabelView_2.LanguageId = '1033'
AND EntityView.Name IN ('Account','Contact')
ORDER BY EntityName, AttributeName




crm company |crm solution provider |business contact manager |microsoft dynamics ax |customer relationship management system |

Customizing CRM by Using the Microsoft Dynamics CRM Developer Toolkit

Thanks Microsoft CRM E2 team to provide this useful Toolkit for CRM developers.

To provide developers with the ability to create and manage on-premise CRM solutions in an integrated Visual Studio environment, the Microsoft Dynamics CRM Engineering for Enterprise (CRM E2) team initiated and sponsored the development of the Microsoft Dynamics CRM Developer Toolkit. The toolkit includes two primary components:

The CRM Explorer
The CRM Explorer complements the CRM
Solution Framework, providing the project factories required to open and build
the solution from within Visual Studio. The Explorer manifests as a window
within Visual Studio 2008 and provides direct access to CRM for creating and
editing business units, security roles, and most importantly, entities. The CRM
Explorer is linked to the solution framework which enables it to intelligently
place generated code into the relevant solution framework project.

The CRM Solution Framework
The CRM Solution Framework is a suite of Visual Studio C# projects that are coupled with CRM Entity customizations and wrapped with extensible MSBuild?based developer builds and daily builds. The Framework contains several ?pre-canned? projects for the typical tasks that are required of developers when undertaking most Enterprise-level CRM projects. Several of these projects have an inheritance model that affords simple and intuitive augmentation, which can significantly reduce the time required to ?jump start? development of new projects.


crmdevelopertoolkit.JPG" />

Software Requirements
Microsoft Dynamics CRM 4.0
Visual Studio 2008 Professional
Visual Studio Team Explorer
StyleCop 4.3 or later (full installation, including MSBuild Integration files)
.NET 3.5 SP1

Installation:
1. Install the CRM Explorer(under folder \CRM Explorer\setup.exe)
2. Install the CRM Solution Framework(under folder \CRMSolutionFrameworkTemplate\Setup.cmd)
Use command prompt to install: Setup.cmd {InstallDir} {ProjectName} {Project Long Name} {Organization Name}

Configuration:
1. Load the project UKDynamics first(Load project normally), then build the solution.
2. Load the project MyCrmSolution(Load project normally), it will referce the UKDynamics class on the step 1. *[1] *[2]
3. From Visual Studio menu bar, click [Tools], then select the [Connect to CRM Server...], give the information then click [OK] button;
4.From Visual Studio menu bar, click [View], then select the [Other Windows]>>[CRM Explorer] *[3]

*[1] If you get warnings like: The referenced component 'UKDynamics.Instrumentation' could not be found. Then you need to re-add the dll reference(UKDynamics.Instrumentation.dll) from UKDynamics\bin folder.

*[2] If you get errors like: The command ""C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil" /i "C:\Projects\MyCrmSolution\SourceCode\MyCrmSolution\Core\Configuration\bin\Debug\MyCrmSolution.Core.Configuration.dll" /f" exited with code 1. Configuration
It because all assemblies are delay-signed, you can turn off the strong-name verification on the dev environment by using the SN tool from Visual Studio 2008 Command Prompt: SN.exe -Vr *,*
then run IISRESET.exe

*[3] If you get errors when expand the item, like:
Client found response content type of 'text/html; charset=utf-8, but expected 'text/xml'. HttpException 1310
Exception message: Could not load file or assembly 'MyCrmSolution.Core.BusinessProcesses, Version=1.1.0.0, Culture=neutral, PublicKeyToken=2c1937e0898110b2' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
It is the same reason and solution with *[2]


Note: The Toolkit is based on components that were initially developed within the Dynamics CRM MCS team in the UK subsidiary. Those components have been refined over a number of UK-based global engagements.

Important: The Microsoft Dynamics CRM Developer Toolkit currently supports customization of on-premise CRM deployments only. This Toolkit and the accompanying documentation are unsupported and are being provided ?as is? by the CRM E2 team to assist developers with managing and extending their on-premise Microsoft Dynamics CRM implementations.


microsoft dynamics crm training |crm best practices |simple crm |crm campaign management |crm 4.0 |

Show both active and inactive records in the lookup view

I had a post about how to return both active and inactive records in the Quick Find View.
People then ask: how to show both active and inactive/deactivated records in the entity's Lookup View?

CRM MVP Batistuta Cai already had a post about a plug-in solution.

If the lookup entity is a system entity, you can also use this technique:

Let's start from an example: you have a custom entity call: MyEntity, you have setup a N:1 relationship between MyEntity and Opportunity, so the user can see an opportunity lookup field on the MyEntity form. Now you want to show users both active and inactive opportunities from that lookup field, all you need to do is put the below code into MyEntity.OnLoad() event:

crmForm.all.new_opportunityid.lookupclass = "alllookups";

The lookup class are controlled via xml files in %ProgramFiles%\Microsoft CRM\Server\ApplicationFiles\
If you take a look at the file: opportunity.xml, you may find a condition like: <condition attribute="statecode" operator="eq" value="0"/>

you can remove the condition, and then use this class, e.g: crmForm.all.new_opportunityid.lookupclass="opportunity"; However it's very much unsupported way(by changing files)! But if you open the file: alllookups.xml, you may find that the opportunity(object type="3") entity doesn't have such condition, so we can use this class to get all opportunities.


realtor crm |crm sfa |dynamics ax |hotel crm |crm customer |

CRM 4.0 IFrame: Show Entity's Associated View

It's a common requirement to show entity's associated view(1:N, N:N) in IFrame, the below code works for both 1:N and N:N relationship, it also works on both On-Premise and IFD deployment. All you need to do is find out(IE Developer Toolbar) the ID of the associated link.

The 1:N relationship needs these parameters in the request URL: oId, oType, security, tabSet
The N:N relationship needs an extra parameter: roleOrd in the request URL, which has been involved in the code.



var navId = "nav_new_new_myentity_account";

if(document.getElementById(navId) != null)
{
var tmp = document.getElementById(navId).onclick.toString();
tmp = tmp.substring(tmp.indexOf("'")+1, tmp.indexOf(";"));
var loadArea = tmp.substring(0, tmp.indexOf("'"));
var roleOrd = (tmp.indexOf("roleOrd") == -1) ? -1 : tmp.substring( tmp.indexOf("roleOrd"), tmp.lastIndexOf("'")).replace("\\x3d", "=");
crmForm.all.IFRAME_view.src = (roleOrd == -1) ? GetFrameSrc(loadArea) : GetFrameSrc(loadArea) + "&" + roleOrd;

}

function GetFrameSrc(tabSet)
{
if (crmForm.ObjectId != null)
{
var id = crmForm.ObjectId;
var type = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
var path = document.location.pathname.substring(0, document.location.pathname.indexOf("edit.aspx")) + "areas.aspx?";

return (path + "oId=" + id + "&oType=" + type + "&security=" + security + "&tabSet=" + tabSet);
}
else
{
return "about:blank";
}
}



Enjoy it! ;-)


crm 3.0 |microsoft crm |crm magic quadrant |microsoft crm online |crm products |

CRM 4.0 IFrame: Show Advanced Find Result View

There are many people asked about: How to show the Advanced Find result view in an IFrame? Instead of building a custom aspx page(dynamically passing parameters, see Adi's solution), I have another method to share if you don't need passing parameters into the query.

1. Build your Advanced Find query and save it, then copy the Shortcut.



2. Put a IFrame control on the Form, clear the "Restrict cross-frame scripting" checkbox.



3. Put the below code to the OnLoad() event, you need to change the IFRAME_view name and the iFrame.src (copy and paste from the step 1)



var iFrame = crmForm.all.IFRAME_view;

iFrame.src = SERVER_URL + "/advancedfind/advfind.aspx?etn=contact&QueryId=%7b3882F0FA-2B3A-DE11-BFB8-0018FE7F3A64%7d&ViewType=4230&AutoRun=True";
iFrame.attachEvent( "onreadystatechange" , Ready);

function Ready()
{
var iDoc = iFrame.contentWindow.document;
if(iDoc.getElementById("crmMenuBar") != null && iDoc.getElementById("btnBack") != null)
{
iDoc.getElementById("crmMenuBar").style.display = "none"; // hide the top menu bar
iDoc.getElementById("btnBack").style.display = "none"; // hide the bottom BACK button
}
}





non profit crm |small business crm solution |onyx crm |benefits of crm |personal crm |

CRM 4.0 : Field Level Security on Print form

CRM 4.0 doesn't provide a true field level security, e.g.: If developers hide attributes/tabs for certain users using crmForm.all.filed.style.display = "none"; These users can still see the field if they Print the record(CRM print preview). I have submitted a feedback to Microsoft about it.

There are no supported way to achieve that, this workaround is not supported and it's not the true field level security!

The file you need to modify is: \CRMWeb\_forms\print\print.aspx
Add the following code just before the ?/html? tag.



<!--
Field level security on Print form
author: Jim Wang @ July 2009
http://jianwang.blogspot.com
-->

<script language="javascript">
var printFrame = document.getElementById("printMain");
var printWindow = document.frames["printMain"];
printFrame.onreadystatechange = function()
{
if(window.opener && printWindow.document.readyState == "complete")
{
//hide attributes
var allFields = opener.document.getElementsByTagName("TD");
for (var i = 0; i < allFields.length; i++)
{
var thisField = allFields[i];
if (thisField.style.display == "none")
{
printWindow.document.getElementById(thisField.id).style.display = "none";
}
}

//hide tabs
var printTabs = printWindow.document.getElementsByTagName("DIV");
var openerTabs = opener.document.getElementsByTagName("LI");
for (var i = 0; i < openerTabs.length; i++)
{
var openerTab = openerTabs[i];
if (openerTab.className && openerTab.className == "ms-crm-Tab")
{
if(opener.document.getElementById(openerTab.id).style.display == "none")
var printTab = printTabs[openerTab.id.replace("tab","").replace("Tab","")];
printTab.style.display = "none";
}
}

}
}
</script>






navision crm |sales force |open source crm software |erp solutions |crm software system |

CRM Filtered Lookup Multi

I had some posts last year about the CRM Filtered Lookup, these technique are broadly used in the CRM community.

The mysterious CRM Lookup (I)
The mysterious CRM Lookup (II)
The mysterious CRM Lookup (III)

A few days ago, I saw a post on the Microsoft Dynamics CRM Chinese Forum about how to add filter to LookupMulti.aspx ?
I think it's a very common requirements, so I'd like to give my idea.
When I start with this customization, my bottom line was: Not change any files/databases. However this customization should be marked as a "unsupported customization" (call CRM/JS function directly).


OK, the question was:
A customized entity: ShippingMark (new_shippingmark), it has N:1 relationship with Account; it also has N:N relationship with Quote.
And as we known by default, Quote has N:1 relationship with Account(via customerid)

So the relationship is simple: Account -< (customerid)Quote >< ShippingMark(new_accountid) >- Account

What the user wants was classic: Open a Quote record, then go to Add Existing ShippingMark, then in the LookupMulti page, only return the ShippingMark which has the same Account(new_account) with Quote's(customerid).

There are two parts of the code: server side Plugin.Execute event and client side CRM.Onload event. What the client side code does is: create a custom lookup window, and pass the customerid as a parameter, so the lookup URL looks like: ?&id=?, then the server side plugin will replace the FilterXml query string based on the parameter.

I give the code prototype for this specific requirement, you need to modify it for re-use. This technique should work for both LookupSingle.aspx and LookupMulti.aspx.


1. Plug-Ins
Register the Execute message on the Pre Stage/Synchronous/Server/Parent Pipeline.



/*
* Microsoft Dynamics CRM Lookup Filter
* Plug-Ins: Execute message on the Pre Stage/Synchronous/Server/Parent Pipeline.
* Jim Wang @ Aug 2009, http://jianwang.blogspot.com, http://mscrm.cn
*
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Web;
using Microsoft.Crm.Sdk;

namespace CRMExecuteEvent
{
public class CRMExecuteEvent : IPlugin
{
string lookupId;

public void Execute(IPluginExecutionContext context)
{

lookupId = HttpContext.Current.Request.QueryString["id"] == null ? null : HttpContext.Current.Request.QueryString["id"].ToString();

if (lookupId == null) return;

try
{
if (context.InputParameters.Contains("FetchXml"))
{
string beforeXml = (String)context.InputParameters["FetchXml"];

if (beforeXml.Contains("<entity name=\"new_shippingmark\">") && beforeXml.Contains("xml-platform"))
{
//Customise the FetchXml query string
string afterXml =
"<fetch version='1.0' page='1' count='100' output-format='xml-platform' mapping='logical'> " +
"<entity name='new_shippingmark'> " +
"<attribute name='new_shippingmarkid' /> " +
"<attribute name='new_name' /> " +
"<attribute name='createdon' /> " +
"<order attribute='new_name' /> " +
"<link-entity name='quote' to='new_accountid' from='customerid'> " +
"<filter type='and'> " +
"<condition attribute = 'customerid' operator='eq' value='" + lookupId + "'/> " +
"</filter> " +
"</link-entity> " +
"<filter type='and'> " +
"<condition attribute='statecode' operator='eq' value='0' /> " +
"<condition attribute='new_name' operator='like' value='%' /> " +
"</filter> " +
"</entity> " +
"</fetch>";

//Replace the FetchXml query string
context.InputParameters["FetchXml"] = beforeXml.Replace(beforeXml, afterXml);

}
}
}

catch (System.Web.Services.Protocols.SoapException ex)
{
throw new InvalidPluginExecutionException("An error occurred in the CRM plug-in.", ex);
}
}

}
}




2. Quote.OnLoad()


var relId = "new_new_shippingmark_quote";
var lookupId = crmForm.all.customerid;

var lookupEntityTypeCode;
var navId = document.getElementById("nav" + relId);
if (navId != null)
{
var la = navId.onclick.toString();
la = la.substring(la.indexOf("loadArea"), la.indexOf(";"));

navId.onclick = function()
{
eval(la);

var areaId = document.getElementById("area" + relId + "Frame");
if(areaId != null)
{
areaId.onreadystatechange = function()
{
if (areaId.readyState == "complete")
{
var frame = frames[window.event.srcElement.id];
var li = frame.document.getElementsByTagName("li");

for (var i = 0; i < li.length; i++)
{
var action = li[i].getAttribute("action");
if(action != null && action.indexOf(relId) > 1)
{
lookupEntityTypeCode = action.substring(action.indexOf("\(")+1, action.indexOf(","));
li[i].onclick = CustomLookup;
break;
}
}
}
}
}
}
}

function CustomLookup()
{
var lookupSrc = "/" + ORG_UNIQUE_NAME + "/_controls/lookup/lookupmulti.aspx?class=&objecttypes=" + lookupEntityTypeCode + "&browse=0";
if(lookupId != null && lookupId.DataValue != null && lookupId.DataValue[0] != null)
{
lookupSrc = lookupSrc + "&id=" + lookupId.DataValue[0].id;
}

var lookupItems = window.showModalDialog(lookupSrc, null);
if (lookupItems) // This is the CRM internal JS funciton on \_static\_grid\action.js
{
if ( lookupItems.items.length > 0 )
{
AssociateObjects( crmFormSubmit.crmFormSubmitObjectType.value, crmFormSubmit.crmFormSubmitId.value, lookupEntityTypeCode, lookupItems, true, null, relId);
}
}
}



microsoft crm online |business contact manager |open source crm |cheap crm |crm magic quadrant |

Build a handy Dynamics CRM development environment

Last month, Sonoma Partners and Microsoft had an very useful article for CRM developers: Setting Up Your Development Environment, I have abstract it into Chinese version. In this post, I'd like to give my idea about how to build up a handy Dynamics CRM development environment.

The typical situation is: A CRM developer runs a Virtual PC image on his/her own PC; the virtual image is a All-In-One CRM system(Windows Server/SQL/IIS/CRM/SharePoint etc.); the Host PC has Visual Studio installed. I'm not going to discuss the mutli-developers sharing one development environment using TFS in this article.

Setup Virtual PC environment:
Microsoft Virtual PC is a free software, it has all we need to host a development environment. You may firstly install Windows Server 2003/2008 on the VPC, then install AD, DNS, IIS 6/7, SQL server 2005/2008, CRM 4, etc. Finally it's a All-In-One CRM box, I'd like to point out that:

1. It can be a Domain Controller - that's for your development only, not for production.

2. You may need 3 Network Adapters in the VPC:
a. Local only - for VPC internal use
b. Microsoft Loopback Adapter - for the communication between Host and VPC
c. Host's Physical Adapter - for the Internet access via the Host PC

The communication between Host and VPC can be used by a Physical Adapter, however think about this situation:
You have a laptop which can be used at home(via Wireless) and company(via Cable), so the IP arrange / Adapter are different.
That's the reason why we need a Microsoft Loopback Adapter in this "handy" environment(BING it: how to set up a Microsoft Loopback Adapter).

3. The VPC can be set up to the On-Premise/IFD mode, so you can develop/test both CRM deployment. You may edit Host's hosts file(e.g.: C:\WINDOWS\system32\drivers\etc\hosts) to point to the IFD URL.


Setup Visual Studio on the Host PC:
You can use Visual Studio to develop/debug CRM on the Host PC, to make it work efficiently:

1. Add user credentials to access VPC (on your Host PC(I suppose it's a Windows XP system, Vista/7 are similar), go to: Control Panel>>User Accounts>>Advanced>>Manage Passwords) , then type in VPC's Server name, User name and Password, click OK to save it.



2. To make the Remote Debug work, the runas account for Visual Studio on the Host PC and the runas account for the Visual Studio Remote Debugging Monitor(msvsmon.exe) on the VPC must use the same user name, it doesn't matter whether users are in two different domains. For example, your VPC domain name call: WIN2K3, your logon user for the VPC is Administrator; However your Host PC's logon user is: CompanyDomain\jimwang, in this case, the remote debugging will not work because it's on different users names. What you can do is, use the local Administrator account on your Host PC to run Visual Studio. E.g.: you can simply create a shortcut on your desktop, target to, e.g.: %windir%\system32\RUNAS.exe /USER:HostPCName\Administrator "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" . These two users must have the same password as well.

3. How to remote debug VPC CRM from the Host PC?
Once you completed the step1 and step2, then make sure the msvsmon.exe is running on the VPC( you can copy the file from your Host PC: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\), the monitor will then waiting for new connections. Go back to your Host PC, set a Breakpoint in your project,
Then click "Debug">>"Attach to process...", in the Qualifier, type in the VPC's server information you created on step 1, e.g.: WIN2K3\Administrator@R2
And then attach w3wp.exe (Managed code).




4. How to deploy the plugins .dll file to VPC?
You need to deploy the .dll file to the VPC's file system in order to Remote Debug(see SDK for more information), the folder is, e.g.: C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly\
You may share the folder and give permission to everyone with full control, then in the Visual Studio, set up the project output path to the shared folder, e.g.: \\R2\assembly\
Now, you may have the experience that, every time you deploy/debug the project, you have to run a IISRESET on the VPC to release the previous .dll file.
I write a Windows PowerShell script to help you do the hard work, your may save it as RecycleCRMAppPool.ps1, then in Visual Studio, make it as the Pre-build event command line of the project. The script will recycle the CRMAppPool before deploy the .dll file.


$server="R2";

$co = new-object System.Management.ConnectionOptions;
$co.Authentication=[System.Management.AuthenticationLevel]::PacketPrivacy;
$co.EnablePrivileges=$true;

$wmi = [WmiSearcher] "Select * From IIsApplicationPool";
$wmi.Scope.Path = "\\$server\root\microsoftiisv2";
$wmi.Scope.Options=$co;

foreach($crmpool in $wmi.Get())
{
if($crmpool.name -eq "W3SVC/AppPools/CRMAppPool")
{
$crmpool.recycle();
}
}




5. You may also use Microsoft Dynamics CRM Develop Toolkit Visual Studio add-on to develop any plugin/workflow assembly/jscript for your CRM project, it will reduce your development time.


crm blog |microsoft dynamics crm 3.0 |crm dashboard |crm development |crm |

CRM ISV Add-On : The entry 'ScriptModule' has already been added

I tested a CRM 4.0 add-on (ISV-A) last week, the default ASPX page generated an error:

Parser Error Message: The entry 'ScriptModule' has already been added.
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</httpmodules>
</SYSTEM.WEB>



The add-on was located under the folder: CRMWeb\ISV\MyAddon
Of cause it inherits settings from CRM's root web.config: in which the ScriptModule has been added by another ISV's (ISV-B) add-on(it shouldn't do it at all).

But if I remove the ScriptModule from ISV-A's web.config, the error changed to:

Unable to cast object of type 'System.Web.Configuration.ScriptingAuthenticationServiceSection' to type 'System.Web.Configuration.ScriptingAuthenticationServiceSection'.

That's because the .Net version of ScriptModule are different between ISV-A and ISV-B's, so we have to stop ScriptModule(ISV-A's) inheriting from CRM's root web.config.

So that what I need to do on ISV-A's web.config:

Just before the ScriptModule, add a <remove> tag, which will remove the inherited setting:

<remove name="ScriptModule">
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">


data warehouse |sales force automation |microsoft crm customization |microsoft business solutions |crm call center |

Change the lookup view on Many-to-Many relationship

The N:N lookup view in CRM 4.0 is very basic: it only shows the primary field on the lookup entity. Say if you create a N:N relationship for Account and Contact, the lookup view looks like:


It's not convenient if you want to see more details of the lookup records. So, how can we change it?
How about if we put the standard view(Active Contacts View, Contact Lookup View, etc) on the left panel - Sounds great!

The solution includes two parts:
1. A customized lookupmulti.aspx in the ISV folder;
- Used for generating the lookup view.
2. Jscript code on the referencing entity(which is 'Account' in this case )
- Used for passing parameters to the custom ASPX page;



First of all, create a new folder under the: \CRMWeb\ISV\
Save the below code as a ASPX file in that folder, so you got, for instance: \CRMWeb\ISV\lookup\lookupmulti.aspx


<!--
-- Show entity's standard View in a N:N LookupMulti dialog window.
-- Jim Wang @ October 2009
-- http://jianwang.blogspot.com
-- http://www.mscrm.cn
-->
<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
<title>Look Up Records</title>
<script type="text/javascript">
var viewDoc = this;
var _mode = 4;
var IS_PATHBASEDURLS = true;
var ORG_UNIQUE_NAME = window.dialogArguments.split("/")[1];
var iTypeCode = window.dialogArguments.substring(window.dialogArguments.indexOf("etc=") + 4, window.dialogArguments.indexOf("&viewid="));
</script>
<script type="text/javascript" src="/_static/_common/scripts/encodedecode.js"></script>
<script type="text/javascript" src="/_static/_controls/util/util.js"></script>
<script type="text/javascript" src="/_static/_common/scripts/global.js"></script>
<script type="text/javascript" src="/_static/_common/scripts/xmlutil.js"></script>
<script type="text/javascript" src="/_static/_controls/remotecommands/remotecommand.js"></script>
<script type="text/javascript" src="/_common/windowinformation/windowinformation.aspx"></script>
<script type="text/javascript" src="/_static/_controls/lookup/lookupdialogs.js"></script>
<script type="text/javascript" src="/_static/_forms/addrelated.js"></script>
<script type="text/javascript" src="/_static/_common/scripts/details.js"></script>
<script type="text/javascript" src="/_static/_common/scripts/select.js"></script>
<script type="text/javascript" src="/_static/_common/scripts/presence.js"></script>
<script type="text/javascript" src="/_static/_controls/number/number.js"></script>
<script type="text/javascript" src="/_static/_controls/lookup/lookup.js"></script>
<link rel="stylesheet" type="text/css" href="/_common/styles/global.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_common/styles/global-styles.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_common/styles/global-dynamic-styles.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_common/styles/fonts.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_forms/controls/form.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_forms/controls/controls.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_common/styles/dialogs.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_controls/lookup/lookupdialogs.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_common/styles/select.css.aspx?lcid=1033" />
<link rel="stylesheet" type="text/css" href="/_controls/notifications/notifications.css.aspx?lcid=1033" />
</head><body><div style="width:100%; height:100%; overflow:auto"><table style="width:100%; height:100%;" cellspacing="0" cellpadding="0"><tr><td colspan="2" class="ms-crm-Dialog-Header">
<div class="ms-crm-Dialog-Header-Title" id="DlgHdTitle">Look Up Records</div><div class="ms-crm-Dialog-Header-Desc" id="DlgHdDesc">Type the information you are looking for in the Look for box and click Find. Then, select the records you want from the Available records list and move them to the Selected records list.</div></td></tr>
<tr><td colspan="2" style="height:100%;"><div class="ms-crm-Dialog-Main" ><div id="divWarning" style="height:100%;">
<script language="JavaScript">

function initFrame() {
viewDoc = document.getElementById("frmResults").contentWindow.document;
tblResults = viewDoc.getElementById("crmGrid").InnerGrid;
if (tblResults == undefined) {
return;
}
}

function createNew() {
openObj(iTypeCode, null, null);
}

function applychanges() {
window.returnValue = buildReturnValue(tblSelected.rows);
window.close();
}

function cancel() {
window.close();
}

function window.onload() {
if (window.dialogArguments) {
document.getElementById("frmResults").src = window.dialogArguments;
document.getElementById("frmResults").onreadystatechange = resultsReady;
}
else {
alert("No arguments found.");
return;
}
}

function resultsReady() {
if (frmResults.document.readyState == "complete") {
initFrame();
viewDoc.body.scroll = "no";
viewDoc.body.style.padding = "0px";
viewDoc.body.style.border = "1px";
viewDoc.body.firstChild.firstChild.firstChild.firstChild.bgColor = "#E3EFFF";
viewDoc.getElementById("crmMenuBar").parentNode.parentNode.removeNode(true);
viewDoc.getElementById("crmGrid").onpropertychange = function() { setTimeout(onAfterChange, 100); }

setNavigationState();
}
}

function onAfterChange() {
initFrame();
setNavigationState();
}

function removeSelected() {
var items = tblSelected.selectedItems;
for (var i = 0; i < items.length; i++) {
items[i].removeNode(true)
}

items.splice(0, items.length);
if (tblSelected.rows.length > 0) {
selectItem(tblSelected, tblSelected.rows[0], true);
}
setNavigationState();
}

function duplicateSelection(oid) {
var len = tblSelected.rows.length;
for (var i = 0; i < len; i++) {
if (tblSelected.rows[i].oid == oid) {
return true;
}
}
return false;
}

function appendItem(id, type, html, originalItem) {
var tr = tblSelected.insertRow();
tr.oid = id;
tr.otype = type;
tr.originalItem = originalItem;

var td = tr.insertCell();
td.className = "sel";
td.noWrap = true;
td.innerHTML = html;

if (tr.rowIndex == 0) {
selectItem(tblSelected, tr, false);
}
}

function appendSelected() {
initFrame();
var items = tblResults.SelectedRecords;
if (items) {
var len = items.length;
var html = "<TD class=ms-crm-List-DataCell align=middle><IMG style='CURSOR: hand' alt='Click to preview' src='/_imgs/grid/row_selected.gif'> </TD>";

for (var i = 0; i < len; i++) {
var o = items[i];

if (!duplicateSelection(o[0])) {

appendItem(o[0], o[1], o[3].innerHTML.indexOf("row_selected.gif") == -1 ? html + o[3].innerHTML : o[3].innerHTML, null);
}
}
setNavigationState();
}
}

function setNavigationState() {
if (tblResults != undefined) {
if (tblResults.SelectedRecords != null && tblResults.SelectedRecords.length != null && tblResults.SelectedRecords.length > 0) {
btnProperties.disabled = false;
btnAppend.disabled = false;
}
else {
btnProperties.disabled = true;
btnAppend.disabled = true;
}
btnRemove.disabled = (tblSelected.rows.length == 0);
tblNoRecords.runtimeStyle.display = (tblSelected.rows.length == 0 ? "" : "none");
}
}

function showProperties() {
initFrame();
var items = tblResults.SelectedRecords;
if (items == null || items.length == null) {
return;
}
if (items.length == 0) {

alert("You must select one object.");
}
else if (items.length > 1) {
alert("You must only select one object.");
}
else {
var nWidth = 560;
var nHeight = 525;
var oWindowInfo = GetWindowInformation(items[0][1]);
if (oWindowInfo != null) {
nWidth = oWindowInfo.Width;
nHeight = oWindowInfo.Height;
}

switch (Number(items[0][1])) {
case Service:
openStdWin(prependOrgName("/sm/services/readonly.aspx?objTypeCode=" + items[0][1] + "&id=" + items[0][0]), "readonly" + buildWinName(items[0][0]), nWidth, nHeight);
break;
case Workflow:
openObj(items[0][1], items[0][0]);
break;
case ImportMap:
openStdWin(prependOrgName("/tools/managemaps/readonly.aspx?objTypeCode=" + items[0][1] + "&id=" + items[0][0]), "readonly" + buildWinName(items[0][0]), nWidth, nHeight);
break;
default:
openStdWin(prependOrgName("/_forms/readonly/readonly.aspx?objTypeCode=" + items[0][1] + "&id=" + items[0][0]), "readonly" + buildWinName(items[0][0]), nWidth, nHeight);
break;
}
}
}

</script>

<table cellspacing="0" cellpadding="0" width="100%" height="100%">
<td>
<table height="100%" width="100%" id="tblFind" cellpadding="0" cellspacing="0">
<tr height="20">
<td>Available records:</td>
<td></td>
<td>Selected records:</td>
</tr>
<tr>
<td width="45%">

<iframe scrolling="no" class="ms-crm-Dialog-Lookup-Results" id="frmResults" ></iframe>

</td>
<td width="60" align="center">
<button id="btnAppend"disabled="disabled" style="width: 40px;" onclick="appendSelected()" title="Add the selected record">>></button>
<p>
<button id="btnRemove" disabled="disabled" style="width: 40px;" onclick="removeSelected();" title="Remove the selected record"><<</button>
</td>
<td>
<div id="rtnObjList" class="ms-crm-Dialog-Lookup-Objects" onkeydown="listKeyDown(tblSelected)" onfocusin="focusSelectedItems(tblSelected, true);" onfocusout="focusSelectedItems(tblSelected, false);">

<table hidefocus="true" tabindex="0" id="tblSelected" cellpadding="2" cellspacing="0" width="100%" onclick="clickItem( this )" ondblclick="removeSelected()"></table>

<table class="ms-crm-Dialog-Lookup-InlineMsg" id="tblNoRecords">
<tr>
<td class="ms-crm-Dialog-Lookup-InlineMsg" align="center">No records have been selected yet.</td>
</tr>
</table>
</div>
</td>
</tr>
<tr height="20" style="padding-top: 10px;">
<td colspan="3" nowrap>
<button id="btnProperties" disabled="disabled" onclick="showProperties();" class="ms-crm-Button" Title="View the selected record's properties" >Properties</button><span style="width: 5px;"></span>
<button id="btnNew" onclick="createNew();" class="ms-crm-Button" Title="Create a new record">New</button>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div></div>
<div id='divFillBg' style='display:none;position:absolute;top:80px;left:20px;height:23px;width:355px;background-color:#ffffff;'> </div>
<div id='divFill' style='display:none;position:absolute;top:80px;left:20px;height:23px;width:0px;filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#00ff00, EndColorStr=#00cc00);'> </div>
<div id='divStatus' style='display:none;position:absolute;top:80px;left:19px;height:23px;width:357px;'><img alt='' src='/_imgs/statusbar.gif' height='23' width='357'></div></td></tr><tr><td class="ms-crm-Dialog-Footer ms-crm-Dialog-Footer-Left"> </td>
<td class="ms-crm-Dialog-Footer ms-crm-Dialog-Footer-Right"><button id="butBegin" onclick="applychanges();" class="ms-crm-Button">OK</button> <button id="cmdDialogCancel" onclick="cancel();" class="ms-crm-Button">Cancel</button></td></tr></table></div>

</body>
</html>



Put the below code into Account.Onload(), you need to replace the: nnId, lookupTypeCode, lookupViewId to yours.


var nnId = "new_account_contact"; // entity N:N relationship id
var lookupTypeCode = 2; // entity type code
var lookupViewId = "A2D479C5-53E3-4C69-ADDD-802327E67A0D"; // the view id of referenced entity

var lookupSrc = "/" + ORG_UNIQUE_NAME + "/ISV/lookup/lookupmulti.aspx";
var lookupArg = "/" + ORG_UNIQUE_NAME + "/_root/homepage.aspx?etc=" + lookupTypeCode +"&viewid=" + lookupViewId;

var lookupEntityTypeCode;
var navId = document.getElementById("nav" + nnId);
if (navId != null)
{
var la = navId.onclick.toString();
la = la.substring(la.indexOf("loadArea"), la.indexOf(";"));

navId.onclick = function()
{
eval(la);

var areaId = document.getElementById("area" + nnId + "Frame");
if(areaId != null)
{
areaId.onreadystatechange = function()
{
if (areaId.readyState == "complete")
{
var frame = frames[window.event.srcElement.id];
var li = frame.document.getElementsByTagName("li");

for (var i = 0; i < li.length; i++)
{
var action = li[i].getAttribute("action");
if(action != null && action.indexOf(relId) > 1)
{
lookupEntityTypeCode = action.substring(action.indexOf("\(")+1, action.indexOf(","));
li[i].onclick = CustomLookup;
break;
}
}
}
}
}
}
}

function CustomLookup()
{
var lookupItems = window.showModalDialog(lookupSrc, lookupArg, "dialogWidth:800px; dialogHeight:600px;");

if (lookupItems) // This is the CRM internal JS funciton on \_static\_grid\action.js
{
if ( lookupItems.items.length > 0 )
{
AssociateObjects( crmFormSubmit.crmFormSubmitObjectType.value, crmFormSubmit.crmFormSubmitId.value, lookupEntityTypeCode, lookupItems, true, null, nnId);
}
}
}


Notice:
  • This is an unsupported customization which does use CRM 4.0 internal functions;
  • Tested on CRM 4.0 Update Rollup 7.



compare crm |crm tutorial |microsoft crm download |insurance crm software |crm software comparison |

Install SharePoint 2010 on a VM environment

When SharePoint 2010 Beta released couple weeks ago, I tried to install it on a VM: What I got for this VM are: Windows Server 2008 R2, SQL 2008 R2(CTP), 1.5GB RAM, etc.

I selected the "Standalone" install, the installation process took about 15 minutes. When it completed, I ran the Configuration Wizard, it failed on the step 5:
Failed to register SharePoint services.
An exception of type System.ServiceProcess.TimeoutException was thrown. Additional exception information: Time out has expired and the operation has not been completed.
System.ServiceProcess.TimeoutException: Time out has expired and the operation has not been completed.


I Googled it, it seems like the RAM is far not enough(minimum 4GB); I also found that modify registry key doesn't help in my case.

The work around I found: Re-Install SharePoint 2010 by using "Server Farm" >> "Complete" option, then both installation and configuration went successful! That's good enough for me to test things. ;-)




low cost crm |web crm |centric crm |ms dynamics crm |online crm |

Microsoft Dynamics CRM 4 Integration Unleashed

Last month, Pearson(Sams Publishing) sent me a book to review. It's the ?Microsoft Dynamics CRM 4 Integration Unleashed?written by Marc and Rajya.

The book covers many areas that you can think of about the CRM 4 integration: Infrastructure Design; Extending CRM; Silverlight Integration; SharePoint Integration; BI; Digital Phone Integration; Master Data Management; Social Network Integration; Mapping Technologies; CRM 4.0 Accelerators; SCOM; VSTS; BizTalk Integration; Azure; Scribe Integration and more.

I really like the fact that the book provides some real world examples and step by step through integrating Dynamics CRM with other products/technologies, it's helpful for CRM architects and developers to get an overview or even in details about CRM Integration.




web based crm software |crm analysis |web based crm solution |customizable crm |crm development |

A thought - the 'xRM Services' for Business Productivity & Collaboration

Microsoft has been very generous in the past few years to enhance functionalities of Windows Servers, i.e.: IIS, Hyper-V, SharePoint Services etc.

I have been thinking for a while and suggested Microsoft the possibility to split the xRM Services from Dynamics CRM; and to make it free, just like the WSS(SharePoint Foundation) and MOSS(SharePoint Server). The xRM Services could be just a 'relational system' base on the entity framework using SQL Express etc.

The major reason for this idea is: Many organisations use the Microsoft Dynamics CRM as a xRM platform, and they are not interested in the classic CRM modules (Sales/Services/Marketing), so they don't want to pay the full license. In my opinion, the "xRM Services" will not only benefit to many organisations, also it will be good for the Dynamics CRM market in long term.

It's just a thought, let's see how it goes.

Happy New Year 2011!




crm marketing software |microsoft dynamics gp |business management software |crm consulting |crm data |

Tom King's CRM Plus

Tom King's CRM Plus

Some Thoughts About Programmatic Agreements
February 4, 2005

I?ve been asked to review a few draft Programmatic Agreements (PAs) lately, proposed for execution under Section 106 and 36 CFR 800.14. They?ve uniformly been pretty dreadful. In case anyone?s interested, I thought I?d share a few observations on one typical example, whose identity I?ve disguised to protect the innocent.

This particular PA was drafted by a State department of transportation (DOT), for signature by itself, FHWA, the SHPO, and an Indian tribe. Once I?d gone through it with a reasonably fine-toothed comb, I could see that it had two modest goals:

1. categorically exclude certain classes of action from standard Section 106 review; and
2. allow the State DOT to represent FHWA in Section 106 consultations with the tribe.

The first thing I want to say is that a PA wasn?t really necessary to achieve either of these goals. With respect to the first, the agency was really saying that it simply didn?t want to communicate in the usual way with the SHPO and tribe about a particular range of action types. This could have been done with some fairly simple exchanges of letters, or a very simple agreement, about how FHWA and the State DOT would initiate consultation under 36 CFR 800.3. By elevating the matter to the level of a PA, they got all balled up, and ironically ended up (as we?ll see) proposing to exclude from review a number of project types that had considerable potential for adverse effect ? just not on resource types that the State DOT figured would be important to the tribe. As for the second goal, it could easily have been achieved (assuming the tribal government found it achievable) through an exchange of letters between FHWA and the tribal government.

But there seems to be a perception abroad in the land that the PA is the only way to structure and adjust relationships among parties in the 106 process, or to clarify how, in the eyes of those parties, the process can be made to work in particular contexts. So in this case as in others, the parties embarked on the PA road, and put their feet in a lot of nasty potholes and piles of poop.

For one thing, they started out by indicating that the agreement was about a lot more than just providing for some exclusions and delegating some responsibilities. It?s title announces that it?s about ?IMPLEMENTATION OF THE FEDERAL-AID TRANSPORTATION PROGRAM IN (THE STATE).? The actual limited purposes of the document are never made clear, except by implication and the absence of stipulations dealing with anything else.

Perhaps in lieu of such stipulations, they stuffed the agreement full of gratuitous promises to obey the law. For example, in the ?Whereas? clauses:

? ?FHWA agrees to coordinate under a government-to-government relationship with federally recognized tribal governments.?

? ?FHWA? wishes to conduct its programs in a manner consistent with 36 CFR 800? (particularly odd since the core purpose of any PA is to allow an agency to conduct a program in a manner inconsistent with the standard process set forth in 36 CFR 800).

And in stipulations:

? ?If the discovery (of Native American cultural items) is located on federal or tribal land, the (State DOT) will submit to the tribe a signed, written Plan of Action in compliance with Sections 10.3 and 10.5(c) of NAGPRA?s regulations.?

Speaking of being gratuitous, they also burdened the document with a number of Statements of Noble Intent (SNI) ? institutional chest-thumps ? such as?

? ?FHWA is committed to the design and construction of transportation systems that achieve a safe and efficient function?.?

Quickly becoming, in the words of Benjamin Disraeli, ?inebriated with the exuberance of (their) own verbosity,? the drafters blew the intent of their PA up to proportions far beyond its actual content:

? ?Now, therefore, (the parties to the PA) aspire to engage in meaningful long term planning for the protection of historic and archaeological properties and, toward that end, desire to (1) develop a comprehensive and efficient process for all Section 106 undertakings; (2) simplify procedural requirements to the maximum extent possible; (3) eliminate unnecessary paperwork; (4) reduce the role of (the tribe?s THPO) to the minimum extent required; (5) devote a larger percentage of time and energies identifying relevant problems threatening historic and archaeological properties; and (6) create innovative programs to address those problems.?

In the face of all this verbiage, the actual two purposes of the agreement ? to exclude certain types of action from what the parties understood to be normal 106 review and to delegate tribal consultation functions ? were virtually buried, and could be ferreted out only with difficulty. At the same time, the high-flying language conveyed the impression that the PA set up a whole new approach to Section 106 review in the state, though it manifestly did not. This is dangerous, because it can mislead people into thinking that given the PA, they need not attend to the regulations, when in fact the regulatory process is hardly affected at all by the PA?s terms.

After two single-spaced pages of generally meaningless circumlocution and SNIs, the PA finally got to one of its major purposes. Oddly, the authors chose a ?Whereas? clause to stipulate that:

? ?(The parties) hereby agree that the transportation undertakings defined in Appendix A have been determined by all parties to have NO EFFECT on cultural resources/traditional cultural properties in (the State) pursuant to 36 CFR 800.?

Never mind what they meant by ?cultural resources/traditional cultural properties,? or how these related to the historic properties whose consideration is the actual subject of 36 CFR 800. The main problem here is that the authors were trying to establish a material fact by executive fiat. It?s kind of like the United States formally declaring in Congress assembled that there are weapons of mass destruction in Iraq. Whether there were WMD in Iraq was a factual question, which could be answered only by on-the-ground study. Similarly, whether something will or will not have an effect on historic properties is a factual matter; one can?t make it one way or another by declaring it so. Under the regulations, determinations of ?no historic properties affected? (which probably is what the drafters meant by ?no effect?) are made based on an agency?s identification work, but in this PA they?re based on nothing at all.

Most of the activities listed in Appendix A do look pretty benign, but one certainly can?t guarantee that they will never have any effect on historic properties. One example is ?rest areas repair and maintenance.? Are there no rest areas in the state with, say, archaeological sites buried under their landscaping, that might be affected by landscape maintenance? Or how about ?replacement of bridges on existing alignment, when the bridge to be replaced is less than 50 years old and is not exceptionally significant?? Does one never excavate to effect such replacement? And who decides about ?exceptional significance??

And once again, the authors couldn?t restrain themselves, and seem to have forgotten what they were doing. They proposed to exclude:

? ?Streetscape improvements including benches, decorative lighting, textured crosswalks, transit shelters, and containerized plantings where the contract does not disturb existing subbase in original ground where soil horizons have been removed;?

? ?Transit improvements, bus bays, bus pullouts, and Park and Ride facilities located in urban settings or previously developed areas.?

? ?Rehabilitation of historic structures in accordance with the Secretary of the Interior?s STANDARDS FOR REHABILITATION and approved by the SHPO.?

These activities are supposed to have ?no effect? on historic properties? Maybe they aren?t likely to affect places important to the tribe, but can a PA whose title indicates statewide and program-wide scope not apply to the whole state, and the whole Federal-aid transportation system in the state? Are the SHPO and tribe not being asked to agree to the wholesale exclusion from review of actions that may have profound effects on buildings, structures, and districts in urban areas? Are they not being asked to do this on behalf of the people in such areas, who value such properties? Without a shred of participation by such parties in the PA consultation? That?s certainly what the PA?s title, and the absence of statements of limitation, suggest. I wonder how any of the State?s cities would react if they found out.

The other apparent purpose of the PA ? delegation of FHWA?s tribal consultation responsibility ? is also buried in a ?Whereas? clause. In fact, it?s a clause within a clause:

? ?Whereas?. when a proposed project includes FHWA funding, the (State DOT) will initiate Section 106 Native American consultation as FHWA?s agent.?

That?s as explicit as it gets. Thereafter, there are simply references to the State DOT sending things to the THPO and the THPO responding. Then at the end, it?s the THPO who?s got a signature line ? not the Chairman, President, or other representative of the tribal government. Can the THPO agree on behalf of a tribe that a Federal agency can delegate government-to-government consultation responsibilities to a state agency? Not in any tribe I?ve ever encountered. No wonder the tribe hasn?t signed off on this PA ? particularly since, I was told, it had simply been sent to the THPO for signature, with no actual consultation at all.

It?s easy to make fun of this PA, but I?m afraid it represents something of a trend. With the Advisory Council?s effective withdrawal from participation in 106 review, and even more from intellectual engagement in the operation of the process, there?s no one to maintain quality control, and I?m seeing some truly amazing agreements being produced and solemnly executed by agencies, SHPOs, and THPOs. The result is likely to be vast confusion at best, severe erosion of the integrity of Section 106 review and real losses of historic properties at worst.

Another result ? not prospective but actual, here and now ? is a lot of time wasted negotiating agreements that amount to much ado about very, very little. The PA I reviewed, like lots of others I?ve seen, is mostly verbiage and puffery, camouflaging a few substantive if confusing and misleading stipulations. And I?ve seen people spend a lot of time arguing about verbiage and puffery.

Finally, as noted at the outset of this paper, there?s no real reason for FHWA or the State DOT to even develop such a PA. An agreement to allow FHWA to delegate its tribal consultation responsibilities to the State could be effected ? if it can be effected at all ? through an exchange of correspondence between FHWA and the tribal government (but probably not the THPO). If the tribe isn?t willing to respond positively to FHWA?s initiative when cast in the form of a letter, a phone call, a meeting, or some combination of the three, it?s not going to be willing to sign a PA. Though perhaps FHWA could con the THPO into signing it without realizing that he was exceeding his authority ? a bit of chicanery that would be a credit to Andrew Jackson.

As for excluding some project types from review, some of the types listed in the exceptions appendix could arguably be excluded unilaterally by FHWA on the grounds that they have no realistic potential for effect on historic properties. Pavement repairs are an example, and re-striping lines. But it?s apparent that what FHWA was concerned about in this case was not Section 106 review in general, but the specific bureaucratic business of consultation with the SHPO and THPO. You don?t need a PA to exclude things from such consultation. Again, I think all it would take is an exchange of letters, or a simple bilateral agreement, about what FHWA and the State DOT would and would not do in initiating Section 106 review under 36 CFR 800.3.

In the hopes of forestalling some future nonsense PAs, I?ve attached, below, suggested drafts of three model letters designed to accomplish the two purposes of the PA reviewed above.

Tom King
Silver Spring, Maryland
February 5, 2005
Attachment 1: Letter: FHWA to head of tribal government

Dear (Chairman/President) ______________

The Federal Highway Administration (FHWA) is seeking ways to simplify its government-to-government consultation with Indian tribes regarding transportation projects in (State), specifically with respect to potential impacts on historic properties under Section 106 of the National Historic Preservation Act.

Such projects are invariably planned and carried out by the (State) Transportation Department (STD). Since you have established your (Name of Office or Department performing THPO function) as your Tribal Historic Preservation Officer (THPO), we believe it would be most efficient for us to authorize the STD to consult directly with your THPO on our behalf regarding all such projects that do not actually affect the fee or trust lands of your tribe. Of course, FHWA will always be available to consult with you on a government-to-government basis upon your request, and will continue to so consult in this manner with respect to projects affecting the fee or trust land of your tribe.

If this arrangement is acceptable to you and your tribal government, I hope you will so advise me by letter. If you would like to meet about this matter, or discuss it on the telephone, I would be happy to do so at your convenience. Please contact me at (phone number) to discuss it or arrange a meeting.

Sincerely


cc: THPO (Note: THPO should already have been consulted about this so it?s not a surprise)

Attachment 2: Letter State Transportation Department to THPO

Dear (THPO)

This is to confirm the outcome of our meeting of (date), at which we identified certain types of transportation project in (State) that are so unlikely to affect historic properties of interest to your tribe that there is no need for us to consult with you under Section 106 of the National Historic Preservation Act. The project types we identified are listed in the attachment to this letter (Attachment A: ?Project Types on Which Section 106 Consultation With the ______ Tribe Will Not Be Routinely Undertaken?).

If you agree, when we consider initiating the Section 106 review process on a project falling into one of the identified categories under 36 CFR 800.3(e) and (f), we will not routinely contact you and request your participation. We will, however, notify you of any such project that will affect the fee or trust lands of your tribe, and of any project that our internal review suggests may be of interest to you. As you requested in our meeting, we will also advise you of any project that is planned to be conducted in the month of _______ within any of the areas identified on the attached map (Attachment B: ?Areas of Special Cultural Importance to the _________ Tribe?), and seek your assistance in ensuring that such projects do not adversely affect your tribe?s cultural interests. We will also consult with you about any project at your request.

We propose to review the effectiveness of this arrangement with you on an annual basis, and make adjustments to the arrangement as needed.

If you agree with this approach, please sign the concurrence line below and return a copy of this letter to you for our files. If you would like to discuss this matter further, please contact me at (phone number).

Sincerely





.

Attachment 3: Letter FHWA to SHPO

Dear (THPO)

This is to confirm the outcome of our meeting of (date). As you will recall, that meeting was aimed at clarifying what the (State) Department of Transportation (DOT) will do when it initiates review of certain routine project types on our behalf under 36 CFR 800.3, and on what your office, the DOT, and we agree constitutes a ?reasonable and good faith effort? to identify historic properties with respect to such project types under 36 CFR 800.4. The authority for this agreement is found at 36 CFR 800.3(g).

The project types we collectively identified are listed in the attachment to this letter (Attachment A: ?Project Types on Which Section 106 Consultation With the ______ State Historic Preservation Officer Will Not Be Routinely Undertaken?). They are all types of project that have very limited potential for adverse effect on historic properties, and whose mild potential for such effects can, we agreed, be handled by the (State) DOT without your advice and assistance.

We agreed that with respect to the property types listed in Attachment A, we will regard our responsibility to consult with you under 36 CFR 800.3(c) to be fulfilled by the programmatic consultation whose results are documented in this letter, and by the annual consultation proposed below, except in circumstances where the (State) DOT?s internal review and our compliance with the National Environmental Policy Act (NEPA) suggest to us or the (State) DOT that further consultation with your office is appropriate, whereupon the (State) DOT will undertake such consultation in accordance with 36 CFR 800.3(c).

We also agreed under 36 CFR 800.3(e) that with respect to the project types listed in Attachment A, there is no need for public involvement in individual project review beyond that routinely carried out by the (State) DOT as part of its planning and NEPA compliance processes, except that in interacting with the public and with local governments about such projects, the (State) DOT will routinely distribute the handout attached (Attachment B: ?If You Have Concerns About Impacts on Historic Places?), which advises the public about how to make any historic preservation concerns known to the (State) DOT, FHWA, and your office. Should any such concerns be raised, or should the (State) DOT otherwise think it necessary, the (State) DOT will provide for further public involvement, in consultation with your office.

We also addressed the requirement of 36 CFR 800.4(b)(1) that a ?reasonable and good faith effort? be made to identify historic properties subject to effect by a project. We agreed that with respect to the project types listed in Attachment A, the (State) DOT?s routine planning and NEPA compliance processes comprise such a reasonable and good faith effort in the vast preponderance of cases, and that no field survey to identify archaeological sites or other historic properties will ordinarily be carried out. We also agreed, however, that the (State) DOT will consult with your office in any case in which they are uncertain about the need for such a survey, and in any case in which a local government, an Indian tribe, or some other interested party requests such a survey. The (State) DOT pledged that such a survey will be carried out if your office advises that it is needed.

Finally, we agreed to review the effectiveness of this arrangement on an annual basis, and make adjustments as needed.

As we discussed, we are contacting all Tribal Historic Preservation Officers (THPOs) and Indian Tribes with interests in your State to seek similar arrangements. Nothing in this letter affects our obligations with respect to such tribes and THPOs.

If you agree with this approach, please sign the concurrence line below and return a copy of this letter to you for our files. If you would like to discuss this matter further, please contact me at (phone number).

Sincerely







customer retention |microsoft crm 3 |microsoft crm certification |crm partners |crm analytics |

THE KEEPER OF THE NATIONAL REGISTER REDEFINES CULTURE:
A COMMENT ON THE KEEPER?S OPINION
OF THE CAPE COD DUNE SHACKS

Thomas F. King
June 1, 2007

Introduction

On May 24, 2007, Janet Snyder Matthews, the Keeper of the National Register of Historic Places, sent a memorandum to the Acting Regional Director of the National Park Service?s (NPS) Northeast Region. The memo provided Ms. Matthews? opinion on whether the ?Dune Shacks of the Peaked Hill Bar Historic District, Barnstable County, Massachusetts? ? a property formally determined eligible for the National Register some 18 years ago ? is significant as a ?traditional cultural property.? Ms. Matthews? memorandum makes some peculiar statements that I think merit critical attention.

With Patricia L. Parker of NPS, I invented the term ?traditional cultural property[1]? as it is used in historic preservation in the United States ? where it is often referred to by its acronym ?TCP.? Parker and I coined the term in National Register Bulletin 38, Guidelines for the Identification and Documentation of Traditional Cultural Properties, published by NPS in 1990. I?ve discussed the background of Bulletin 38 ? why we wrote it, its intent, our choice of terminology, in several publications[2], and will not reiterate here. Ms. Matthews? opinion in the dune shacks matter is of concern to me because it evidences a deep misunderstanding of the ?TCP? concept, an unKeeperly unfamiliarity with National Register Bulletin 38, and an assumption of governmental omniscience that I find bothersome in an ostensible public servant.

I will not discuss the character of the dune shacks here, other than to note that they comprise a collection of cottages mostly constructed by and used in the past and currently by artists, poets, writers, and other members of the arts community. This community has considerable time depth in the area. The shacks and the people who value them have been discussed in detail by ethnographer Robert Wolfe in a 2005 evaluation[3], and by Wolfe and T.J. Ferguson in a 2006 report[4]. The Peaked Hills Historic District, including the dune shacks, was determined eligible for the National Register in 1989 under National Register Criteria A, B, and C.

The question of the shacks? traditional cultural significance came up a few years ago as NPS undertook to evict some of the shacks? residents. Since the residents maintain the shacks, and since the district was determined eligible for the Register at least partly because of its significant association with its residents and their artistic endeavors, questions arose over the propriety of these actions. In undertaking them, as far as I have determined, NPS did not bother to comply with Section 106 of the National Historic Preservation Act. Apparently, however ? and I am rather reading between the lines here ? NPS then was persuaded that it had Section 106 responsibilities with regard to the shacks, and that if the shacks were eligible as a TCP, the residents would have more power in the Section 106 consultation process than would be the case otherwise. The State Historic Preservation Officer opined that the shacks did in fact comprise a TCP. Unable to bring itself simply to respect the community and its traditional associations, NPS contracted for a study, performed by Dr. Wolfe. Dr. Wolfe concluded that the dune shacks were indeed significant as a TCP. Unwilling to accept this conclusion without vetting, NPS had Dr. T.J. Ferguson examine Dr. Wolfe?s work; the result was the Wolfe-Ferguson report, concluding that the dune shacks were eligible for the National Register as a TCP. The residents and various local governments offered supporting opinions. But NPS was still unsure, so it requested the ?determination? of the Keeper ? an NPS employee, but we are not to imagine that this might have made any difference. The Keeper, in simple terms, said no.

The Meaning of the Keeper?s Opinion

For a government action that has caused such sturm und drang, the Keeper?s opinion is curiously meaningless. Meaningless, that is, in real world terms; what meaning it may have in the world where the Keeper and her associates live can only be guessed.

Let?s be clear about what the category ?TCP? means. TCP is not a National Register criterion, separate and apart from the formal criteria A, B, C, and D[5]. It is really a descriptive term, like ?cottage,? or ?archaeological site,? or ?big gray rock.? When we wrote Bulletin 38, Parker and I needed a term to embrace a range of place-types that were being given short shrift by government despite their significance to real people ? Native American spiritual places, traditional neighborhoods, culturally valued landscapes and landforms, and so on. No term was sufficiently embracing, so we invented one ? traditional cultural property. It?s simply a semantic box, or envelope, within which various types of place can be kept.

So, who is authorized to decide whether something is or isn?t a TCP? Well, who is authorized to decide whether something is a cottage, or an archaeological site, or a big gray rock? It depends, of course; if you?re a geologist and I?m not, your opinion about the big gray rock is probably better than mine. But archaeologists can argue over what is and isn?t an archaeological site, and one person?s cottage may be another?s palace and another?s hovel. In any event, cottageness, siteness, and rockness are more or less matters of opinion, on which people can honestly reach divergent conclusions, and ? here?s the important point ? no government agency has the authority to decide the matter.

In just the same way, no government agency has the authority to decide whether something is or is not a TCP. The Keeper has the authority to decide whether a given TCP (or non-TCP) is eligible for the National Register, but she has no more official role in deciding whether something is a TCP than she has in deciding whether something is a rock, a boat, or a fig tree.

Who can determine whether something is a TCP? According to National Register Bulletin 38:

?It is vital to evaluate properties thought to have traditional cultural significance from the standpoint of those who may ascribe such significance to them?[6]

In other words, traditional cultural significance is defined and determined by the people who know and care about a place. The bulletin goes on to acknowledge that a group?s assertions about a place can and should be ?subjected to critical analysis,? but the bottom line is the obvious truism that only I can say what?s important to me, and only you can say what?s important to you. Neither of us needs the Keeper to instruct us in the matter.

So the Keeper?s opinion is simply an opinion. It?s also an opinion without practical consequence. The district remains eligible for the National Register, under criteria A, B, and C. The dune shacks contribute to the district; their use by artists and their colleagues is understood to be part of the district?s significance. Any eviction or demolition action by NPS would obviously require review under Section 106[7]. The dune dwellers would be entitled to be consulting parties in any such review, based on their interests in the district[8].

So what did the Keeper?s opinion mean? Only that in the Keeper?s opinion, the shacks are not significant as a TCP. This opinion must have deep meaning to the Keeper, but in real world terms it is simply one ostensible specialist?s conclusion, to be compared and contrasted with those of the residents, Wolfe, Ferguson, the SHPO, and others in future evaluations of the place.

If the Keeper?s opinion has marginal relevance to the dune shacks themselves, it has rather chilling implications for other TCP cases. We may, and should, wonder what will happen when other properties of traditional cultural significance, not already on or determined eligible for the Register, are brought to the Keeper for determinations of eligibility or as nominations. To judge from Ms. Matthews? memorandum, the prospects for official recognition of such significance are not good. The Keeper appears to be unfamiliar with the National Register?s own guidance on the evaluation of TCPs, and to have some strange notions about what makes such properties significant.

The Keeper?s Understanding of National Register Bulletin 38

Ms. Matthews? memorandum includes what purports to be a summary of what Bulletin 38 says about TCP evaluation, reproduced below.

Traditional Cultural Properties

National Register Bulletins provide guidance and technical information regarding the evaluation of cultural resources. National Register Bulletin #38 provides flexible guidance regarding the evaluation and documentation of TCPs. In general, as discussed more fully in the Bulletin, a TCP has the following characteristics:

A living, traditional group or community;
The group/community must have existed historically and the same group/community continues to the present;
The group/community must share cultural practices, customs, or beliefs that are rooted in the group/community?s history;
These shared cultural practices, customs, or beliefs must continue to be held or practiced today;
These shared cultural practices, customs, or beliefs must be important in maintaining the continuing cultural identity and values of the group/community;
The group must transmit or pass down these shared cultural practices, customs, or beliefs through the generations, usually orally or through practice; and
These shared cultural practices, customs, or beliefs must be associated with a tangible place, and the place must be directly associated with the identified cultural practices.

Most of the bulleted sentences and sentence fragments are accurate enough glosses on what Bulletin 38 actually says. The second bullet, however ? ?The group/community must have existed historically and the same group/community continues to the present? ? is not found in Bulletin 38 in any form I can discern upon rereading the publication. The Keeper appears simply to have made it up. She goes on, in explaining ?why the dune shacks? does (sic) not have significance as a TCP,? to lean entirely on this putatively ?most important characteristic of a TCP? as her basis for concluding that the dune shacks don?t comprise one. This suggests to me that Ms. Matthews is unfamiliar with the actual language of the bulletin, and/or that over the years since its publication her staff have begun to read into the bulletin a standard that its authors never intended to include ? and moreover, to elevate this standard to ?most important? status. This, as we?ll see, is a problem.

The Keeper?s use of the ?historical existence/continuation to the present? standard

Why is there a problem with employing the standard that Ms. Matthews and her people have invented? It seems intuitively obvious that a group ascribing ?traditional? significance to a place must have existed long enough to have traditions, and must exist today in order to honor them. The problem with this standard, however, is rooted in the question of who defines traditional significance. If, in the bulletin?s words, we are to ?evaluate properties thought to have traditional cultural significance from the standpoint of those who may ascribe such significance to them,? is it legitimate for someone standing outside the group ? most notably a government official ? to evaluate the legitimacy of the group?s perceptions? If ? as the bulletin details ? it is inappropriate for us to question whether an Indian tribe?s ancestors ?really? emerged from a lower world at the beginning of time, is it legitimate for us to deny the beliefs of the Cape Cod dune dwellers about their history, and indeed their very existence as a group?

If the dune dwellers had dragged their shacks into the dunes last year, it might not be problematic to apply the ?historical existence/continuation to the present? (HE/CP) standard, though I think the wisdom of doing so would still be questionable. But the dune dwellers did not arrive yesterday; they?ve been around for quite awhile, so the Keeper has to develop a convoluted rationale for denying them legitimacy. The fact that she is willing and able to do this, in the face of massive contrary evidence, bodes ill for future human-based TCP evaluations.

Ms. Matthews? argument ? to the extent I can extract its essence from her prose ? goes like this:

The community (she would probably put the word in quotes) of dune dwellers is made up of several groups, including long-term and short-term occupants, visitors, and so on.
These groups are ?fluid, evolving, and different from one year to the next.?
Wolfe?s and Ferguson?s reports focused on the long-term occupants.
Many of those offering opinions about the dune shacks emphasized the relevance of groups that do not comprise long-term occupants.
Some comments suggest that the groups using the shacks are so fluid that no ?cultural focus? can be discerned[9].
Therefore, ?the District should not be identified for its significance as a TCP.?

If the reader?s response to this argument is ?huh?? I am not surprised; that?s my response, too. Granting the accuracy of points 1 through 5, it is utterly unclear, at least to me, how Ms. Matthews jumps to point 6 (which actually is the lead-in to her discussion). How does inclusion of multiple subgroups, fluidity, a tendency to evolve, year-to-year differences in composition, the existence of groups other than the long-term occupants, and questions about ?cultural focus? (whatever that is) translate into non-TCP status? Presumably it has something to do with the newly-minted HE/CP standard, but even if one accepts that standard, the intellectual leap Ms. Matthews has made is difficult (impossible, for me) to follow. Apparently Ms. Matthews would not deny that the long-term occupants as a group have ?historical existence,? and it is pretty evident that this group ?continues to the present.? If this is true, then presumably Ms. Matthews would regard the dune shacks as comprising a TCP if there were no one there but the long-term occupants. But by having the temerity to die or move away from time to time and be replaced by others, the long-term dune dwellers have compromised their historical/cultural legitimacy in Ms. Matthews? eyes.

Apparently to the Keeper, if the community that ascribes significance to a property has been so gauche as to change over time, its claim to ?community? status has been lost, and it doesn?t really value the places it thinks it values. But historians, anthropologists, and sociologists have pretty thoroughly documented the fact that all human societies change, evolve; all have more or less fluid boundaries. If there is one immutable principle of human existence, it is mutability. By Ms. Matthews logic, then, no living community can have a TCP. And of course, no dead one can either, since it has not ?continued to the present.?

Let?s imagine the HE/CP principle and Ms. Matthews? logic applied to a more ?traditional? sort of TCP than the dune shacks. Suppose an Indian tribe asserts that a hill somewhere in its traditional territory (or elsewhere) is an important spiritual place, and is misled into nominating it to the National Register[10]. In evaluating the nomination, the Register will have to ask whether the tribe?s composition and boundaries have changed and evolved over time. It would be a rare tribe for which the answer to this question would not be ?yes.? The Keeper might be satisfied that the tribe ?existed historically,? as evidenced by historical accounts, archaeology, perhaps oral history, perhaps treaties, but has it ?continued to the present?? Well, the Keeper might say, maybe it has and maybe it hasn?t; it all depends on how fluid the group?s boundaries are. So ? assuming the tribe has patience with this kind of effrontery ? the tribe submits its tribal rolls for the last century or two. And ? what do you know? ? they document a considerable fluidity. Not only have tribal members been born and died, but people have come into the group through marriage, perhaps through adoption, while others have left or been thrown out. Some tribal members come and go; a couple live in Switzerland, one member has been elected to the House of Representatives and lives in suburban Virginia. Oh dear, can this really be seen as a community? Guess not, so its place can?t be a TCP.

If this hypothetical seems absurd, I will only say that I don?t think it any more absurd than the Keeper?s opinion about the dune shacks. Since the Keeper?s decision in this matter was pretty obviously a politically motivated one, we can hope that it will not be replicated in cases where the National Park Service is not the agency questioning a place?s traditional cultural significance, but I have my doubts. The Keeper certainly engaged in convoluted, unsubstantiated logic (broadly defined) to reach the conclusion desired by her agency, but the fact that such logic apparently makes sense to her and her colleagues ? that they can put it out in public with straight faces ? cannot make one very hopeful about the quality of likely future decisions.




[1] Also taken to mean ?traditional cultural place,? which amounts to the same thing; we used ?property? in order to parallel ?historic property,? a term used in the National Historic Preservation Act.
[2] See, for instance, Chapter 15, ?Stupid TCP Tricks,? in Thinking About Cultural Resource Management: Essays from the Edge; AltaMira Press 2002; Chapters 1 and 2 in Places That Count: Traditional Cultural Properties in Cultural Resource Management, AltaMira Press 2003; and ?How Micronesia Changed the U.S. Historic Preservation Program and the Importance of Keeping it from Changing Back,? Micronesian Journal of the Humanities and Social Sciences 5:1/2:505-516, http://marshall.csu.edu.au/MJHSS/
[3] Dwelling in the Dunes: Traditional Use of the Peaked Hills Bar Historic District, submitted to the National Park Service 2005.
[4] Traditional Cultural Property Assessment, Dune Shacks of the Peaked Hills Bar Historic District, Cape Cod National Seashore, submitted to the National Park Service 2006.
[5] As set forth in regulation at 36 CFR 60.4
[6] National Register Bulletin 38:4, emphasis added.
[7] This is not, however, to say that NPS will subject its decisions in such matters to such review; it is required to, after all, only by federal law.
[8] 36 CFR 800.2(c)(5)
[9] The Keeper does not define this somewhat ambiguous term.
[10] For the record, I recommend NEVER nominating TCPs, or anything else, to the National Register unless there is a very good practical reason for doing so.




easy crm |crm business intelligence |siebel crm on demand |cmr |ecommerce crm |