Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Does anybody have any experience making content organizer rule based on a Lookup column with more than 20 values in the list? (When you have more than 20 values, the view of the Lookup field changes. Instead of a select it turns into a text input, image and select control).

When you make a rule based on this type of column the selected value will not me memorized. This means that you can perfectly add a new rule, but once you try to edit it the selected values won't be recognized (the lookup will be reset to "none").

After debugging the Microsoft.Office.Policy.Pages.dll (EditRule class) I noticed problem occured in the following method:

private BaseFieldControl GetBaseFieldControlForCondition(int clauseNum, int fcIndexWithinClause)
{
      return (this.conditionControls.Controls[0].Controls[(clauseNum * this.availableColumns.Items.Count) + fcIndexWithinClause].Controls[3] as BaseFieldControl);
} 

This is standard SharePoint code and we can't change it. I would want to log this case with Microsoft, but before I do this I would like to know if somebody knows more about this issue or has had any problems with it recently.

I think I'm fairly close to finding a solution, but my inspiration is failing me. There's a certain HTML tag that gets selected, which value is returned/used for further functionalities (You can't see this inside the methode).

Normally this value is the same as the lookupId, but once there are more than 20 items, the html changes and the value return is equal to 0. A possible solution would be to address the control (that is selected in the above codebehind) using JQuery and set the correct value.

The problem is that I can't find a way to get the control that corresponds to this code.

In the aspx page in the layouts folder we can see the following code:

<table id="conditionControlTable"><tr><td id="conditionControls" runat="server"/></tr></table>

As You can see this is the conditionControls tag, that gets addressed by the above code. This however, will stay empty in the masterpage locally. I assume this means that it's content gets assigned in the clientside code. When the page is rendered the code looks as follows: http://www.pastie.org/3303266

I debugged the function GetBaseFieldControlForCondition with refector pro. This means that I repeatedly tested according to one scenario whereby i used the following parameters:

clauseNum: 0, this.availableColumns.Items.Count = 5, fcIndexWithinClause = 3.

This means that when you look at the function GetBaseFieldControlForCondition you get:
(this.conditionControls.Controls[0].Controls[3].Controls[3] as BaseFieldControl);

So if you copy the HTML from pastie, you should be able to address a certain element. Unfortunately this is not the case.

If somebody could help me, I would sincerily appreciate it.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.