Tag Info

Hot answers tagged

9

Why do you need mappings First things first: let me explain, why do you need to use mappings at all. With some accuracy it can be said, that a Choice field in SharePoint represents a DropDownList control. And in the ASP.Net DropDownList control, each item (ListItem, to be precise) has two essential properties: Text and Value. Obviously, Value property acts ...


8

You could use a unicode character that does not print anything. I tried it with U+205F and it seemed to work as expected. To put this character in, open up the charmap (Start->Run->charmap) on your machine, then select a font that has unicode support (I chose calibri), scroll almost to the bottom and find the U+205F. You can then double click the ...


6

Looks like you're using default Update method of SPContentType when updating your content type in feature updating receiver. To push changes to all inherited list content types, you should use another overload of the Update method, and pass true to it: contentType.Update(true); Description of the parameter from MSDN: updateChildren Type: ...


5

You can do it in InfoPath, cascading drop downs. But since you said you need to do it in jQuery, there is a very useful library, called SPServices, available to assist. Marc has created a function in the library to do cascading drop downs, which is exactly what you want. Look over that information and see if it's helpful.


4

Choice fields are returned with a Value without the need for expansion: Example: IP_WorkflowStatus = IP_WorkflowStatusValue Here is an example of a query without using expansion: $filter=IP_WorkflowStatusValue eq '2-Validated' If you want to use expansion, then you need to use expanded field notation Relation/Field: $filter=IP_WorkflowStatus/Value eq ...


3

The only solution not involving code is: Create the column as: Choice Not required Unique Choices: 1, 2, 3, 4 and 5 (not None) Drop-Down Menu Clear default value That'll allow the users to create any number of entries without a priority, but only one for each of the 5 values. This seems is like you want it to work. BUT once an entry has been assigned ...


3

SPFieldChoice has a property named FieldRenderingControl. Using reflector you can find this code in the FieldRedneringControl property: .... switch (this.EditFormat) { case SPChoiceFormatType.Dropdown: control = new DropDownChoiceField(); break; case SPChoiceFormatType.RadioButtons: control = new RadioButtonChoiceField(); ...


3

You can find details about <Mappings> in [MS-WSSCAML]: Collaborative Application Markup Language (CAML) Structure Specification V0.1 "MAPPINGS: A set of MAPPING string elements that represents a canonical, languageagnostic identifier for a corresponding CHOICE with the value specified by the MAPPING element. The reader MUST ignore MAPPINGS if the ...


3

Descerning the original values from the user filled-in is easy, as the additional values entered by a user are not added to the original choice field definition, which will remain unaltered. So, in order to retrieve all the list items where the choice field value is not one of the predefined values, you need to build a CAML query with the NEQ operator on ...


3

Multi-choice field values are stored internally in ArrayList How to get multi-choice field values in PowerShell $web = Get-SPWeb $Url $list = $web.Lists[$ListTitle] $item = $list.GetItemById($ItemId) $values = new-object Microsoft.SharePoint.SPFieldMultiChoiceValue($item[$fieldName]) //print multi-choice field values for($i=0;$i -lt $values.Count;$i++) ...


2

It can be done in InfoPath or using jQuery and the SPServices cascading dropdowns function.


2

It is not supported for multiselect fields (i.e. fields represented in the normal UI as check boxes). The following quote is for 2013 but the same rules apply for the ListData.svc. You can filter on the client side, though, depending on how you represent the data and the controls you use. Queries for multi-value lookup fields and users Because ...


2

Where "spfc" is an object of type SPFieldChoice: int year = DateTime.Now.Year - 5; for (int i = 0; i < 10; i++) { spfc.Choices.Add((year + i).ToString()); } spfc.Update();


2

In the end I have followed the direction proposed by Stuart and marked this still another SharePoint blackhole, so I have left any hope of using this CAML tag as last for now. During my research I had a look at many classes in the framework but I cannot find anything related to using the mapping "attribute", so I can only assume that it was an uncompleted ...


2

There is an explanation how to fix your problem, but I'm not sure that this solution is good, because you should change sharepoint fiels. I think that the best way is to change logic of your application.


2

There are a couple ways you can do this but they aren't really "out of the box" because these are your own custom rules. Add some JavaScript to your New/Edit forms If you are familiar with JavaScript, this is probably the easiest method since you don't need to deploy any code to the server. You can edit the forms to use jQuery or Prototype.js + ...


2

All credit goes to Xiang Zeng for providing the answer, many thanks! This is a bug in Sharepoint. However, there is a workaround. Directly modifying the SchemaXml property to change the choices is allowed: public override void ItemAdding(SPItemEventProperties properties) { base.ItemAdding(properties); string itemTitle = ...


2

SPServices has a method for this: The SPArrangeChoices rearranges radio buttons or checkboxes in a form from vertical to horizontal display to save page real estate. The documentation is here: SPServices.SPArrangeChoices


2

If you must avoid creating WFs or event handlers, then another option is to use a Calculated field with bunch of new columns (AssignedOn, TimeToInProgress, etc.). For the first duration: time taken to change from Assigned to In Progress The first time the user changes the status of the document to Assigned set the AssignedOn column to current date and ...


2

From my experience this will have to be done programmatically. Add a new managed metadata column manually then write a console app or PowerShell to loop trhough the items/documents and match the selected value with the managed metadata equivalent. Then do a SystemUpdate(false) on the item (the false part will preventing the version from being increased) ...


2

You can use the GetFieldValue method of the field class if you are unsure of the actual type of the underling value. For example: item["MyChoiceField"] = listIstance.Fields["MyChoiceField"].GetFieldValue("Choice1");


2

What you are looking for cannot be done using event handlers. You need to use selected index changed event of the dropdown control in your form pages.


2

There isn't that functionality out of the box, but it can be done with custom javascript or editing the forms with InfoPath.


2

I've done what Unnie describes above before. First you create a list and populate it with all your choice values. Then you configure your list people will add items to by creating a new column of type lookup that points to the list you just created using the Title column. You set it to allow fill in votes. Then in a workflow, you check if a fill in option ...


2

Try this $(document).ready(function(){ $('#ctl00_m_g_de548742_27f6_4e71_b3ec_2d9a1ecca117_ff151_ctl00_DropDownChoice').on('change', function(){ var accountType = this.value; if(accountType == 'Military') { $('.milShow').show(); $('.ctrShow').hide(); $('.civShow').hide(); } ...


1

maybe somthing like this? // Get a reference to the field. SPFieldMultiChoice choiceField = (SPFieldMultiChoice)list.Fields.GetField(fieldInternalName); // Create a field value with all choices selected. // (A CheckBoxChoiceField control would have all boxes checked.) SPFieldMultiChoiceValue values = new SPFieldMultiChoiceValue(); foreach (string choice in ...


1

I think the content type hub is a red herring here - I suspect you have an index set on one of those altered columns. Go to List settings for the lists affected and click "Indexed Columns" below the Columns section. Find the offending indexes and remove them. Then create a new template and try to spin up a new site with the new template.


1

Quick and dirty solution is to Enable versioning and it will give some level of delta.


1

Short answer: No. The only (out of the box) ways to do this are: Lookup field (PRO: behaves as a choice field when rendered) (CON: only works within 1 site only) Managed metadata, adding the value as a synonym (PRO: works everywhere) (CON: is type ahead, so looks different from choice field)


1

What you're describing sounds like a Cascading Lookup. There are several existing questions with suggestions for implementing such a thing: How can we get Cascading Lookup Columns in sharepoint 2010? How to implement Cascaded lookup in SP 2010? How to make a filtered lookup field



Only top voted, non community-wiki answers of a minimum length are eligible