Search code examples
c#xmlsharepointecm

Sharepoint 2010 Content Organiser Condition String xml


I’m working with the Sharepoint 2010 Content organiser and setting the conditions property programmatically.

It's the EcmDocumentRouterRule.ConditionsString property which accepts a string representation of the following xml fragment:

<Conditions><Condition Column='F38E4008-F1C7-476C-8FB1-17C0A363D16B|Crisp Name|Crisp Name' Operator='Equals' Value='quavers' /></Conditions>

I have a Content Type with column called 'Crisp Name'. When its value is ‘quavers’ it should carry out some action. I think the issue is getting the right operator value, but I don't know which one should be used. The Content Organiser rule gets created successfully but when I try and edit it in Sharepoint I get a runtime error. If I remove this condition from my code I am able to view and edit the rule in Sharepoint as expected. I need the condition to make use of Equals, have tried a few variations including ‘==’ and ‘Eq’ not sure what it is that’s missing here.

This is quite an urgent requirement any help would be greatly appreciated


Solution

  • Thanks for that willfg useful to know for reference. However after stepping through things again but on a fresh site collection with fresh content type, fresh column, it turned out my issue was to do with case sensitivity on the column feature id - it needs to be lower case. I tried 'Equal' and 'IsEqual' and both added the condition correctly. I was able to view and edit the rule through the UI in both cases. Thanks for your time though much appreciated