Calc Columns - Referencing Columns that are not supported
I have 2 columns:
Column A is a choice column that can have multiple selections
Column B is a choice column that allows only a single selection
The formula I want to create checks Column A to see if only a single, specific selection was selected, in this case "Title". If that is the case, then I want the calculated column to display "Title, "&[column B]"
The problem is that SharePoint won't allow a formula to contain a column that can have multiple selections. Can anyone think of a way around this?
A brute force method might be to replace Column A with a bunch of single choices, and create another column to display them all together..
Byron.
November 19th, 2010 12:35pm
You might try a workflow that updates a checkbox field (called multiple items or something like that) if there are multiple values.
Hope that helps,
SharePointNinja
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2010 5:11pm
I don't think you can do this OOTB; you're going to have to do some custom coding. You're looking at either an event handler for the list or a workflow. I think the Event Handler is the better call here since you don't need to involve other people
through tasks.
Some things to consider:
You can't edit a calculated field in code. Instead, you'll have to use a single line of text field and then hide it. Take a look at
this article for a quick and dirty way to hide these fields on NewForm.aspx, EditForm.aspx and DispForm.aspx. There are other ways, but they're a lot harder.
Be sure to disable events when saving (base.DisableEvents()) and re-enable them when you're done (base.EnableEvents()).
Choice fields come in a wonky format ([ID];#[Value]) so you'll need to be ready for that (see this article). Your single entry list may come out fine, but the multi-entry
list will definitely have that format. Use ItemAdded/ItemUpdated rather than ItemAdding/ItemUpdating; you don't need BeforeProperties and AfterProperties in this case.
So your Event Handler should have the following steps:
Get the entry/entries from List A Convert to an array or hash. If the array/hash has more than one entry, stop.
If the lone entry in the array contains "Title", then add the value you want to your hidden single line of text field. If the entry does not contain "Title," stop.
HTH.
http://www.Twin-Soft.com
November 22nd, 2010 10:04pm