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

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");


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

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

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

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++) ...


3

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(); } ...


3

This should do it: Download jQuery and save it to /SiteAssets/ Create a JavaScript file named comma-break.js and save it in /SiteAssets/ with the contents of: $(document).ready(function () { var str = $('.ms-listviewtable').html(); //; $('.ms-listviewtable').html(str.replace(new RegExp(", ", "g"), ",</br>")); }); Add a Content Editor ...


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

Since you don't want to perform extra requests to get the values, it means that the relationship between the two fields must be present somewhere in the form page. The way to do this would be to store this relationship in a SharePoint list: |Title | Choice | | A1 | A | | B1 | B | etc. Add this list as a Web Part, hidden below your form. ...


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

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

Just create the Choice field as a drop down list with the only option of Yes and set no default value. When an item is submitted an empty value will be set in the list. If a user sets the field and wants to revert back to no value, they'll be forced to go into datasheet mode to remove the selection. THe regular editform will not give them a means to ...


2

A free downloadable plugin which uses jQuery and SPServices can be downloaded here: http://www.itidea.nl/index.php/cascading-dropdowns-with-jquery-and-spservices-on-a-page-or-webpart/


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

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

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

You will need to create the structure using SPServices.CascadeDropdowns like 404 said. Also make sure you have the fields that you want auto-populated set up as required fields. If they are not required and for some reason don't want them required you can do the following (I would recommend requiring the fields, I just wrote this out before that crossed my ...



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